I managed to make a navigation drawer and trying to get a button working now.
Code:
public class FourthFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fourth_layout, container, false);
}
public void buttona1(View view){
Intent browserIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("https://www.google.nl"));
startActivity(browserIntent);
}
}
Layout:
<Button
android:text="Magister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="buttona1"
android:id="@+id/button2"
android:visibility="visible"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
The problem is that when I open the app in my mobile and move to the button page, push the button the app will close and stop working.