Skip to main content

Posts

Showing posts from April, 2013

Bring Android application to forground

Intent launchApp = new Intent(context, Applications_MainActivity.class);                             launchApp.setAction(Intent.ACTION_MAIN);                             launchApp.addCategory(Intent.CATEGORY_LAUNCHER);                             launchApp.setFlags(IConstants.NOTIFICATION_FLAG);//Use this Special Flag                             context.getApplicationContext().startActivity(launchApp); Update below value in your Constants File,   public static final int NOTIFICATION_FLAG = 0x10200000;

IS MY SERVICE RUNNING? - DISPLAY ALL RUNNING SERVICES IN ANDROID

Compare your service name with class name of running services to find out your service is running or not. ActivityManager activityManager= (ActivityManager)getSystemService(ACTIVITY_SERVICE);         for (RunningServiceInfo service : activityManager.getRunningServices(Integer.MAX_VALUE)) {             Log.i("Service", "Process " + service.process + " with component " + service.service.getClassName());         }