Hei guys。私はAndroidプログラミングの新機能です。私はrc車(Arduino)を制御するアプリケーションを作ろうとしています。このアプリでは、次の活動です:アクティビティ間のAndroidアプリケーションスワップが停止します
- ボタンについて
私はアプリを開くと、それが突然停止し、I
Button buttonCommand;
Button tiltCommand;
Button vocalCommand;
Button instructions;
Button about;
Button arduino; // Links Button
Button android; // Links Button
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.content_main);
buttonCommand = (Button)findViewById(R.id.buttons);
tiltCommand = (Button)findViewById(R.id.tilt);
vocalCommand = (Button)findViewById(R.id.vocal);
instructions = (Button)findViewById(R.id.instructions);
about = (Button)findViewById(R.id.about);
arduino = (Button)findViewById(R.id.arduino);
android = (Button)findViewById(R.id.android);
}
public void onClickButton(View view){
Intent i = new Intent(getApplicationContext(),ButtonCommand.class); // ButtonCommand Activity
startActivity(i);
}
public void onClickTilt(View view){
Intent i = new Intent(getApplicationContext(),TiltCommand.class); // TiltCommand Activity
startActivity(i);
}
public void onClickVocal(View view){
Intent i = new Intent(getApplicationContext(),VocalCommand.class); // VocalCommand Activity
startActivity(i);
}
public void onClickInstructions(View view){
Intent i = new Intent(getApplicationContext(),Instructions.class); // Instructions Activity
startActivity(i);
}
public void onClickAbout(View view){
Intent i = new Intent(getApplicationContext(),About.class); // About Activity
startActivity(i);
}
public void onClickArduino(View view){
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse("http://forum.arduino.cc/"));
startActivity(intent);
}
public void onClickAndroid(View view){
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse("http://forum.xda-developers.com/"));
startActivity(intent);
}
ブナ・ジョージ、LogCatに表示されるメッセージを追加することは非常に重要です – Jorgesys
ねえ。知っている。私のPCは少し遅く走っていて、私は伝統的なデバッグモードを使用しています。アプリをコーディングし、apkを作って自分の携帯電話にインストールします。申し訳ありませんが、LogCatメッセージを提供できません。 –
電話でLogCatを実行することもできます。 – tynn