I am trying to get this Service
to open another app upon start up using the URI in the code. My BroadcastReciever
and manifest have the correct code so I suspect it is something in this mainActivity
.
I am using Eclipse and there are no errors or warning but when run on the phone i get the following error:
Unfortunately anyConnectService has stopped
The LogCat has the following as the first error:
FATAL EXCEPTION MAIN
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.anyconnect/com.anyconnectservice,MainActivity}
Please glance at the following code and offer a solution.
Thanks
public abstract class MainActivity extends Service
{
@override
public void onCreate()
{
super.onCreate();
Toast.makeText(this, “Service created”,Toast.LENGTH_LONG).show();
Uri anyConnectUri = Uri.parse(“anyconnect://connect/name= TestVPN”);
Intent arg0 = new Intent(Intent.ACTION_VIEW, anyConnectUri);
this.startActivity(arg0);
}
}