I've been working on my first true Android app for a few weeks, and I've been running into a bit of a problem. My app utilizing the Eclipse with the Android ADK can connect to a database that I have on a site, but when it tries to move towards the next activity it doesn't work. What is the problem?
Login.Java snippet:
success = json.getInt(TAG_SUCCESS); if (success == 1) { Log.d("Login Successful!", json.toString()); Intent n = new Intent(Login.this, ReadComments.class); finish(); startActivity(n); return json.getString(TAG_MESSAGE); ReadComments.class snippet:
public class ReadComments extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.read_comments); } @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add("Register") .setIntent(new Intent(this,Register.class)); menu.add("New Reservation") .setIntent(new Intent(this, NewReservation.class)); menu.add("About Luxury Parking") .setIntent(new Intent(this, Aboutus.class)); return true; } }
startActivity(n);beforefinish()