我创建了一个按钮蓝牙。当我点击按钮时,它应该开始一个新的活动,而不是应用程序关闭。
我查看了Logcat,我看到了:
W/HwLauncher:时钟 getDataFormat getSystemString 失败。
//in Main
bluetooth = (Button) findViewById(R.id.bluetooth);
bluetooth.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(), "Bluetooth Device Not Available", Toast.LENGTH_LONG).show();
Intent intent = new Intent(getApplicationContext(), bluetooth.class);
startActivity(intent);
}
});