Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

android studio see what activity you came from

// Activity A and Activity B both send to Activity C
// In order to decide which Activity you came from use the following code:

// In Activity A:
Intent intent = new Intent(this, C.class);
intent.putExtra("camefrom", "A");
startActivity(intent);

// In Activity B:
Intent intent = new Intent(this, C.class);
intent.putExtra("camefrom", "B");
startActivity(intent);

// In Activity C:
Intent intent = getIntent();
String cameFrom= intent.getStringExtra("camefrom");

if(cameFrom.equals("A");
// It is from A
else
// It is from B
Comment

PREVIOUS NEXT
Code Example
Java :: interviewbit_java 
Java :: how to clear cli screen 
Java :: collapsingtoolbarlayout collapse listener 
Java :: v2ray 
Java :: login in java with 3 attepmtps 
Java :: java create a random number 
Java :: java bild skalieren bufferedimage 
Java :: get cursor position in textarea java 
Java :: subtract two variables in java 
Java :: Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : java.util.zip.ZipException: invalid code -- missing end-of-block 
Java :: public class Hello { public static void main( String[] args ){ System.out.println("Hello World"); } } 
Java :: java private keyword 
Java :: what does put extra do? 
Java :: list all managed beans in spring 
Java :: regex pattern for car plates 
Java :: java reverse nodes with single node 
Java :: java Map to LinkedHashMap with ascending order of keys 
Java :: buat tetris dari java 
Java :: sphere 
Java :: reset android studio settings windows 
Java :: Copying Arrays Using Assignment Operator Java 
Java :: boolean parse jtextfield 
Java :: java 8 if else in one statement 
Java :: javafx check if enter pressed 
Java :: java int data type 
Java :: how to find last digit in number by regex in java 
Java :: java windowbuilder full screen 
Java :: Accesses Constructor of Abstract Classes 
Java :: set attribute java 
Java :: httpsession vs cookie servlet 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =