Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Create a button that redirects to another activity in android studio

Button btn = (Button)findViewById(R.id.open_activity_button);    

btn.setOnClickListener(new View.OnClickListener() {         
        @Override
        public void onClick(View v) {
            startActivity(new Intent(MainActivity.this, MyOtherActivity.class));
        }
});
Comment

PREVIOUS NEXT
Code Example
Java :: java to check if its a number scanner 
Java :: difference between access specifiers and access modifiers in java 
Java :: java download file from url 
Java :: How to count the number of islands (groups of adjacent 1s) in a grid of 1s (land) and 0s (water), in Java? 
Java :: android list[index] 
Java :: How to find the second smallest value in an array without sorting it in Java? 
Java :: Who made java ? 
Java :: java how to get all threads 
Java :: Java Stack class peek() method 
Java :: java quotes in string 
Java :: slicing array in java 
Java :: java join two list 
Java :: how to convert milliseconds into second in android studio 
Java :: check GPS is on android 
Java :: sum of a list using for loop in dart 
Java :: Exception in thread main java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file 
Java :: split number java 
Java :: Failed to collect dependencies at net.sf.jasperreports:jasperreports:jar:6.2.0 
Java :: java replace string case insensitive 
Java :: measure running time of a statement java 
Java :: last char in string java 
Java :: set path in windows 
Java :: write an infinite loop java 
Java :: java print statement 
Java :: volley library 
Java :: Java How to use Set? 
Java :: java long to double 
Java :: convert fileinputstream to string java 
Java :: which api is android 12 
Java :: java convert float to double 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =