安卓开发,点击实现第三方接口事件
代码块:
public class MainActivity extends ActionBarActivity implements OnClickListener{
private ImageButton imgBt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
imgBt = (ImageButton) findViewById(R.id.imageButton1);
imgBt.setOnClickListener(this);
}
@Override
public void onClick(View v) {
Log.i("tag", "第三方实现类被实现了");
}
控制台显示如下:
[2017-05-25 11:43:53 - buttonP02] ------------------------------
[2017-05-25 11:43:53 - buttonP02] Android Launch!
[2017-05-25 11:43:53 - buttonP02] adb is running normally.
[2017-05-25 11:43:53 - buttonP02] Performing com.example.buttonp02.MainActivity activity launch
[2017-05-25 11:43:53 - buttonP02] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD '4.0'
[2017-05-25 11:43:54 - buttonP02] Application already deployed. No need to reinstall.
[2017-05-25 11:43:54 - buttonP02] Starting activity com.example.buttonp02.MainActivity on device emulator-5554
[2017-05-25 11:43:56 - buttonP02] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.buttonp02/.MainActivity }
[2017-05-25 11:43:56 - buttonP02] ActivityManager: Warning: Activity not started, its current task has been brought to the front
为什么呢?