Home > Mobile >  Reuse in the android button to monitor how this error? In the new activity
Reuse in the android button to monitor how this error? In the new activity

Time:10-10

Package com. Mycompany. Myapp;

The import android. App. *;
The import android. OS. *;
The import android. Widget. *;
The import android. View. The view. *;
The import android. View. *;
The import android. Database. Sqlite. *;
The import android. View. The view. An OnClickListener;
Public class PuTongActivity extends the Activity
{
Private ListView list;
Private SQLiteDatabase db.

Protected void onCreate (Bundle savedInstanceState)
{
Super. OnCreate (savedInstanceState);
The setContentView (R.l ayout. Putongliangma);
The Button btn1=(Button) the findViewById (R.i d.p tlm3);
The Button btn2=(Button) the findViewById (R.i d.p tlm4);
The Button btn3=(Button) the findViewById (R.i d.p tlm5);
The Button btn4=(Button) the findViewById (R.i d.p tlm6);
The Button btn5=(Button) the findViewById (R.i d.p tlm7);
The Button btn6=(Button) the findViewById (R.i d.p tlmzy);
Btn1. SetOnClickListener (this);
Btn2. SetOnClickListener (null);
Btn3. SetOnClickListener (null);
Btn4. SetOnClickListener (null);
Btn5. SetOnClickListener (null);
Btn6. SetOnClickListener (null);
}
}

CodePudding user response:

Your activirty does not implement an OnClickListener interface

CodePudding user response:

Ok, thank you! Could you tell me how to give you points?

CodePudding user response:

Use this method to inherit the View. An OnClickListener interface

Public class MainActivity extends AppCompatActivity implements the View. An OnClickListener {
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

}

CodePudding user response:

Your activity class to inherit the View. An OnClicklistener
  • Related