Changing Activity on a clickable layout
I have this clickable LinearLayout
view, im trying to have it change Activity
when clicked by every time i click the object i get a error.
final LinearLayout lindet = (LinearLayout) findViewById(R.id.detials);
lindet.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent i = new Intent(SellingActivity.this, DetailsActivity.class);
startActivity(i);
finish();
开发者_StackOverflow }
});
Did you remember to add the DetailsActivity
to the AndroidManifest
?
Supporting Macarse I would add that use SellingActivity.this.finish()
instead of finish()
I believe this will prove to be your problem solver.
精彩评论