0
我按照下面的這個鏈接,我已經生成了2個通知,顯示在onCreate。Android簡單通知
How to create a notification with NotificationCompat.Builder?
我的問題是,我怎麼能在Web瀏覽器中打開一個網頁,當你按下的通知?
這是我的代碼
Wait a seccond , i'm a newbie .. I have this code
public class MainActivity extends Activity {
private WebView mWebView;
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.notif)
.setContentTitle("Notification title1")
.setContentText("Notification text1");
NotificationCompat.Builder pBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.photoline)
.setContentTitle("Photoline Studio")
.setContentText("App sponsorizate de Photoline Studio!");
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, mBuilder.build());
notificationManager.notify(1, pBuilder.build());
我應該在哪裏把那個意圖是什麼?
啊我是個新手,我不知道如何實現代碼到我的腳本..我現在貼出我的代碼 –
試圖實現按我的更新。 thnx –
好吧,我發自我這樣做這樣 –