I try to use Sybase Unwired Platform with generated code for Android. I have exception in following code:
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Application app = Application.getInstance();
String AppName = "timesheets";
if (app.getApplicationIdentifier() == null)
app.setApplicationIdentifier(AppName);
if (app.getApplicationContext() == null)
app.setApplicationContext(this); //Place where app crashes
Debug window look like this:
All crashes after beginning of execution of that line:
Android version is 4.1.2 (API 16)
Why does it crash?
I don't even know what Sybase is, but I don't believe setting application context to Activity is good idea.
this
refers to Activity, doesn't it?Actually, I can't even find that method in Android API:
Looked here: Application and ContextWrapper and Context
What are you trying to archive by this line?