package com.example.alarm; import java.util.Calendar; import android.app.Activity; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.util.Log; public class AlarmActivity extends Activity { private BroadcastReceiver receiver = new BroadcastReceiver() { @Override Log.v("MainActivityID", keyword1);// 理想はこちらでアラーム後の値を拾いたい。 } }; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); alarmtimeset(); IntentFilter filter = new IntentFilter(); filter.addAction("com.example.action.ALARM"); registerReceiver(receiver, filter); } @Override protected void onDestroy() { super.onDestroy(); unregisterReceiver(receiver); } public void alarmtimeset() { Log.v("TEST", "アラームセット"); for (int intc = 0; intc < 5; intc++) { Intent intent = new Intent(getApplicationContext(), AlarmReceiver.class); // ReceivedActivityを呼び出すインテントを作成 intent.putExtra("hogeID", "ID" + intc); intent.setType("Hoge" + intc); PendingIntent sender = PendingIntent.getBroadcast(AlarmActivity.this, 0, intent, 0); // ブロードキャストを投げるPendingIntentの作成 // calendar.set(2013,9,7,10,50,0+intc*10);//時刻を手動で設定 AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE); // AlramManager取得 am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender); // AlramManagerにPendingIntentを登録 } } }
Standard input is empty
Main.java:15: error: class AlarmActivity is public, should be declared in a file named AlarmActivity.java public class AlarmActivity extends Activity { ^ Main.java:5: error: package android.app does not exist import android.app.Activity; ^ Main.java:6: error: package android.app does not exist import android.app.AlarmManager; ^ Main.java:7: error: package android.app does not exist import android.app.PendingIntent; ^ Main.java:8: error: package android.content does not exist import android.content.BroadcastReceiver; ^ Main.java:9: error: package android.content does not exist import android.content.Context; ^ Main.java:10: error: package android.content does not exist import android.content.Intent; ^ Main.java:11: error: package android.content does not exist import android.content.IntentFilter; ^ Main.java:12: error: package android.os does not exist import android.os.Bundle; ^ Main.java:13: error: package android.util does not exist import android.util.Log; ^ Main.java:15: error: cannot find symbol public class AlarmActivity extends Activity { ^ symbol: class Activity Main.java:16: error: cannot find symbol private BroadcastReceiver receiver = new BroadcastReceiver() { ^ symbol: class BroadcastReceiver location: class AlarmActivity Main.java:26: error: cannot find symbol public void onCreate(Bundle savedInstanceState) { ^ symbol: class Bundle location: class AlarmActivity Main.java:16: error: cannot find symbol private BroadcastReceiver receiver = new BroadcastReceiver() { ^ symbol: class BroadcastReceiver location: class AlarmActivity Main.java:27: error: cannot find symbol super.onCreate(savedInstanceState); ^ symbol: variable super location: class AlarmActivity Main.java:28: error: package R does not exist setContentView(R.layout.main); ^ Main.java:31: error: cannot find symbol IntentFilter filter = new IntentFilter(); ^ symbol: class IntentFilter location: class AlarmActivity Main.java:31: error: cannot find symbol IntentFilter filter = new IntentFilter(); ^ symbol: class IntentFilter location: class AlarmActivity Main.java:25: error: method does not override or implement a method from a supertype @Override ^ Main.java:38: error: cannot find symbol super.onDestroy(); ^ symbol: variable super location: class AlarmActivity Main.java:36: error: method does not override or implement a method from a supertype @Override ^ Main.java:43: error: cannot find symbol Log.v("TEST", "???????"); ^ symbol: variable Log location: class AlarmActivity Main.java:45: error: cannot find symbol Intent intent = new Intent(getApplicationContext(), AlarmReceiver.class); // ReceivedActivity????????????? ^ symbol: class Intent location: class AlarmActivity Main.java:45: error: cannot find symbol Intent intent = new Intent(getApplicationContext(), AlarmReceiver.class); // ReceivedActivity????????????? ^ symbol: class Intent location: class AlarmActivity Main.java:45: error: cannot find symbol Intent intent = new Intent(getApplicationContext(), AlarmReceiver.class); // ReceivedActivity????????????? ^ symbol: method getApplicationContext() location: class AlarmActivity Main.java:45: error: cannot find symbol Intent intent = new Intent(getApplicationContext(), AlarmReceiver.class); // ReceivedActivity????????????? ^ symbol: class AlarmReceiver location: class AlarmActivity Main.java:48: error: cannot find symbol PendingIntent sender = PendingIntent.getBroadcast(AlarmActivity.this, 0, intent, 0); // ????????????PendingIntent??? ^ symbol: class PendingIntent location: class AlarmActivity Main.java:48: error: cannot find symbol PendingIntent sender = PendingIntent.getBroadcast(AlarmActivity.this, 0, intent, 0); // ????????????PendingIntent??? ^ symbol: variable PendingIntent location: class AlarmActivity Main.java:54: error: cannot find symbol AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE); // AlramManager?? ^ symbol: class AlarmManager location: class AlarmActivity Main.java:54: error: cannot find symbol AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE); // AlramManager?? ^ symbol: class AlarmManager location: class AlarmActivity Main.java:54: error: cannot find symbol AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE); // AlramManager?? ^ symbol: variable ALARM_SERVICE location: class AlarmActivity Main.java:55: error: cannot find symbol am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender); // AlramManager?PendingIntent??? ^ symbol: variable AlarmManager location: class AlarmActivity 32 errors
Standard output is empty