So far from all the tutorials I've looked at, most only get to the point of "Button Was Clicked". I need my second activity button to open a new activity.
I named this class, fifth_layout.xml:
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Amazon"
android:drawableLeft="@drawable/amazon"
android:drawableStart="@drawable/amazon"
android:layout_weight="0.07"
tools:ignore="HardcodedText"
android:id="@+id/button10"
android:textSize="35sp" />
After that in my FifthActivity.java I have:
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class FifthActivity extends Activity {
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fifth_layout);
Button button = (Button) findViewById(R.id.button10);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {}
});
}
}
I just need the button to be able to open a new blank activity. But when I click the button nothing happens. I just need a new activity. I feel like the code is correct but I just need help on what I might be doing wrong.