私はJavaにかなり慣れていないので、NotSerializableException
受け取ったこれを解決できないようです。ユーザーの sdcard にオブジェクトを書き込んでいますが、次にそれを読み取る必要があります。
これは私のコードです:
@Override
protected void createAndAttachView(int id, FrameLayout frame) {
//Read the panel from the memory
PanelWrapper pnl = (PanelWrapper) readObjectFromMemory(B4AHelper.getDirDefaultExternal(), "layout.frame");
//Add the view
frame.addView(pnl.getObject());
//Broadcast an intent to the user.
intent = new IntentWrapper();
intent.Initialize("createAndAttachView", "");
intent.PutExtra("id", id);
intent.PutExtra("message", "View Attached");
sendBroadcast(intent.getObject());
//Log - debugging
Log.i("B4A", "View attached!");
}
ここからreadObjectFromMemory
andを使用していますが、これはエラーです:writeObjectFromMemory
Error Message: anywheresoftware.b4a.BALayout
Error Message: Read an exception; java.io.NotSerializableException: anywheresoftware.b4a.BALayout
Caused by: java.lang.NullPointerException
at com.rootsoft.standout.MostBasicWindow.createAndAttachView(MostBasicWindow.java:53)
at com.rootsoft.standout.StandOutWindow$Window.<init>(StandOutWindow.java:2213)
at com.rootsoft.standout.StandOutWindow.show(StandOutWindow.java:1416)
at com.rootsoft.standout.StandOutWindow.onStartCommand(StandOutWindow.java:716)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2359)
... 10 more
私はかなり新しいので、できるだけうまく説明できればいいのですが、これは他の人にも役立つかもしれません.