开发者

Changing Activity on a clickable layout

开发者 https://www.devze.com 2023-02-04 05:13 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消