У меня есть намерение к другому классу, и все, что он делает, просто фиксирует ошибки. Я использую код, который я получил от ответа на вопрос, который я задал.
Имя моего пакета: com.exercise.AndroidAlarmService
Класс, который я пытаюсь назвать: .Hello
Ниже приведен пример того, как я называю класс, но его не работает. Я не являюсь экспертом в android, поэтому объяснение в новинках будет оценено по достоинству.
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);
использование
callIntent.setClassName("com.exercise.AndroidAlarmService",
"com.exercise.AndroidAlarmService.Hello");
Вместо
callIntent.setClassName("com.exercise.AndroidAlarmService", ".Hello");
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.exercise.AndroidAlarmService",
"com.exercise.AndroidAlarmService.Hello");
startActivity(intent);