Can't Start New Activity
Good day, I try to start new Activity from another. But it always crashed. Here My code. It is the event on ListView. list.setOnItemClickListener(new OnItemClickListener(){
Solution 1:
instead of
Intent i = newIntent(view.getContext(), StudentInfoActivity.class);
change to
Create staticobject of that activity
e.g Activity actOne =null;
publicstatic actOne a ;
a = this;
Intent i = newIntent(a, StudentInfoActivity.class);
Solution 2:
try this one.
Intent i = newIntent(getApplicationContext(), StudentInfoActivity.class);
i.putExtra("studentId", selectedId);
startActivity(i);
Post a Comment for "Can't Start New Activity"