Reputation: 793
I have an intent to another class and all it does it just flag up errors. I am using some code that i got from a answer to a question i asked.
My package name is : com.exercise.AndroidAlarmService
The class i am trying to call is : .Hello
Below is how i am calling the class, buts its not working. I am not an expert in android so a explanation in beginners terms would be appreciated.
Log.i("Service", "onStart() is called");
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
callIntent.setClassName("com.exercise.AndroidAlarmService", ".Hello");
startActivity(callIntent);
Upvotes: 1
Views: 513
Reputation: 2004
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.exercise.AndroidAlarmService",
"com.exercise.AndroidAlarmService.Hello");
startActivity(intent);
Upvotes: 1
Reputation: 132972
use
callIntent.setClassName("com.exercise.AndroidAlarmService",
"com.exercise.AndroidAlarmService.Hello");
Instead of
callIntent.setClassName("com.exercise.AndroidAlarmService", ".Hello");
Upvotes: 2