I have a BroadcastReceiver and it there is some problem. The Toast message is showing, and the logcat message is appearing with the command line logcat tool, but not in the Android studio Logcat display. Why? I have already tried android:debuggable="true"
and anything has not changed.
public class AlarmReceiver extends BroadcastReceiver {
private String filePath;
private Ringtone ringtone;
@Override
public void onReceive(Context context, Intent intent) {
Log.d("RECEIVE", "");
Bundle extras = intent.getExtras();
if (extras == null) {
filePath = null;
} else {
filePath= extras.getString("filePath");
}
Log.d("Filepath in receiver", filePath);
ringtone = RingtoneManager.getRingtone(context, Uri.parse(filePath));
ringtone.play();
Toast.makeText(context, "Fooo", Toast.LENGTH_LONG).show();
// setRingsong(context, filePath);
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…