1
私はアンドロイドで通知を作成しようとしています。アイコンが表示され、テキストがぼやけます。また、それをクリックすると、インテントは呼び出されません。 (私はウェブブラウザを立ち上げるべきテストの意図を持っている)。 テキストが消える理由を理解できず、sttusバーをクリックするとブラウザが表示されません。 コードアンドロイドが通知を作成する方法を理解しようとしています
public class Welcome extends Activity
{
private NotificationManager mNotificationManager;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mNotificationManager = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
Notification notifyDetails = new Notification(
R.drawable.icon, "Click Me!", System.currentTimeMillis());
Context context = getApplicationContext();
CharSequence contentTitle = "Notification Details...";
CharSequence contentText = "Ted";
Intent notifyIntent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://www.android.com"));
PendingIntent intent = PendingIntent.getActivity(this, 0, notifyIntent,
android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
notifyDetails.setLatestEventInfo(context, contentTitle,
contentText, intent);
mNotificationManager.notify(1, notifyDetails);
}
}
テッド