好吧,这个错误对我来说是无法想象的,我甚至不知道该怎么去google了。 这是我最初的课程的一部分。 (You can view the whole thing here)为什么我的班级创作被跳过
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i("Avariel", "I am running");
RealmManager realmManager = new RealmManager();
Log.i("Avariel", "I have passed RM");
在这里面我想创建一个类域管理器(You can view the whole class here)的。在这一点上,我甚至可以得到"I am running Realm Manager's on Create"
显现。当我调试它只是冻结。
public class RealmManager extends Activity {
public static final String TAG = MainFragmentActivity.class.getName();
private Realm realm;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i("Avariel REALM", "I am running Realm Manager's on Create");
/**
* https://realm.io/docs/java/latest/#getting-started
* http://facebook.github.io/stetho/
* https://github.com/uPhyca/stetho-realm
* chrome://inspect/#devices
*/
/* Stetho.initializeWithDefaults(this);
Realm.init(this);
Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
.build());
realm = Realm.getDefaultInstance();
realm.beginTransaction();
Player player = realm.createObject(Player.class);
player = player.create(01, "Gideon", "Barlock", "Orc", "Lawful Evil", "Fighter", "A wandering Warrior", 0, 30, 0, null, null, null, null, null, null, null, null, null, 0);
realm.commitTransaction();
Realm.init(this);
RealmConfiguration config = new RealmConfiguration.Builder().build();
Realm.setDefaultConfiguration(config);*/
}
@Override
protected void onDestroy() {
super.onDestroy();
realm.close();
}
含义日志我看到
05-27 22:38:13.477 32158-32158/com.example.gideonsassoon.avariel I/Avariel: I am running
05-27 22:38:13.559 32158-32158/com.example.gideonsassoon.avariel I/Avariel: I have passed RM
我做了什么错在这里。You can view the full project here
非常感谢您的帮助,
为什么'RealmManager延伸Activity'? –