When i run this code the activity is never started by the service even if i write if percentage<100
i have also tested by creating a while loop in calling startservice(); still the service does not go in startservice.
So how can i start my activity from this service??
public class Myservice extends Service {
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated
Why won't this work? Just trying to pass a editable string from one activity to another. But I cannot get it to work. Does the string passed through the intent have to be pre defined?
I am creating a service in my applicatoin.
Here is the code i used.
public class LocationService extends Service{
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
Log.e("Location Service", "onStrat of service");
}
@Override
public void onCreate() {
super.onCreate();
Lo
I create an application with alarm manager and broadcast receiver and i want pass string from main activity to public class MyScheduleReceiver extends BroadcastReceiver(i have alarm manager inside) and then to public class MyStartServiceReceiver extends BroadcastReceiver for pass data to static function....In main activity save this variable from editbox with shared preferences.But i can not use s
I know this question has been asked many times, but all the other threads didn't solve my issue at all, I can't see anything wrong with my code.
In my application, I have created a notification feature through which Activity_1 gets called.
I have no problem in passing data to a service using intent, extras, etc and using startService(intent)
Intent intent = new Intent();
intent.setClass(MainActivity.this, MediaPlayerService.class);
intent.setAction(MediaPlayerService.PLAY_PAUSE);
intent.putExtra("URI", URI);
intent.putExtra("TITLE", content.toString());
//PendingIntent.getService(MainActivity.this, 0, intent, 0);
startService(inte
Hi friends i have a problem...
Actually i use this code to open my application in certain time..the app is working fine but when the device is in sleep mode not working..??
public class MyBroadCastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context ctx, Intent intent) {
Intent intent = new Intent(ctx, ActivityMain.class);
intent.addFlags(Intent.FL
what are the reasons that would affect my intent not to load the next activity i've fixed my manifest the intent is correct the button is okey and the activity is good basically i don't have any errors or i don't see any can anyone clear this things for me i need help..this is my intent if you would like to check it
final Intent intent = new Intent();
intent.setClass(MainActivity.this