Hi, need some help here. I successfully followed chapter 1 and everything worked fine except at the end of the chapter after creating the AVD EMULATOR to run the app.Android Studio said build successful but the phone is blank, not showing the app, the phone just said ANDROID. I read a similar topic before posting this one but my issue is not the same. bellow is my code.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="24dp"
android:text="@string/question_text"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/true_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/true_button"/>
<Button
android:id="@+id/false_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/false_button"/>
</LinearLayout>
package com.bignerdranch.android.geoquiz;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
private Button mTrueButton;
private Button mFalseButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mTrueButton = (Button) findViewById(R.id.true_button);
mTrueButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//does nothing yet but soon
Toast.makeText(MainActivity.this,
R.string.correct_toast,
Toast.LENGTH_SHORT).show();
}
});
mFalseButton= (Button) findViewById(R.id.false_button);
mFalseButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//does nothing yet but soon
Toast.makeText(MainActivity.this,
R.string.incorrect_toast,
Toast.LENGTH_SHORT).show();
}//end of public void
});//end of setOnClickListener
}
}
Thanks in advance .