From a activity onClick event need to start an activity and a service also.
I have implemented that. But problem is that service is starting but activity is not loading properly. Only blank screen is coming. Sorry message is coming “Application is not responding” and asking me to either to wait or force close it.
@Override
public void onClick(View arg0) {
startService(new Intent(NewUIM.this, MyService.class));
Intent i = new Intent(NewUIM.this, NewUI.class);
startActivity(i);
finish();
}
});
Implement
AsynTaskwhile theServiceis running and implement theActivity. For more information, check the link : http://developer.android.com/reference/android/os/AsyncTask.html