Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

restart application programmatically android

Intent mStartActivity = new Intent(context, StartActivity.class);
int mPendingIntentId = 123456;
PendingIntent mPendingIntent = PendingIntent.getActivity(context, mPendingIntentId,    mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager mgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent);
System.exit(0); //you can also kill your app's process
Comment

PREVIOUS NEXT
Code Example
Java :: print hashtable in java 
Java :: best ascii art characters 
Java :: java stop executing my program 
Java :: java int to binary string 
Java :: how to add image in title bar in android 
Java :: android clear specific sharedpreference value 
Java :: android java toast 
Java :: java connect mariadb 
Java :: ubuntu java development kit 
Java :: american heavy tanks of ww2 
Java :: how to iterate over a string in java 
Java :: java split string on two or more spaces except for words in quotes 
Java :: coding collections clear method java 
Java :: java coding problems 
Java :: char variable java 
Java :: sum of all numbers in array java 
Java :: string to long java 
Java :: javafx textarea font size 
Java :: remove new line in string of java 
Java :: create date java 
Java :: android java convert double to 2 decimal places 
Java :: hashmap sort by value descending 
Java :: java string swap two characters 
Java :: java get random char 
Java :: android hide system bar programmatically 
Java :: java log2 
Java :: java substring 
Java :: java jpa criteriabuilder in xample 
Java :: sort list of strings java 
Java :: area of circle in java 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =