|
Home » Archives for 03/27/13
Save $350 on Apple 15.4" MacBook Pro quad-core Intel Core i7 2.7GHz
Create a PendingIntent for Notification to do nothing
Refer to the last post "error of using NotificationCompat.Builder, IllegalArgumentException: contentIntent required", if you want no action perform when user click on the Notification, you can insert a PendingIntent with a dummy Intent.
Example:
Example:
PendingIntent pendingIntent = PendingIntent.getActivity(
MainActivity.this,
0,
new Intent(), //Dummy Intent do nothing
Intent.FLAG_ACTIVITY_NEW_TASK);
myNotification = new NotificationCompat.Builder(context)
.setContentTitle("Exercise of Notification!")
.setContentText("http://android-er.blogspot.com/")
.setTicker("Notification!")
.setWhen(System.currentTimeMillis())
.setContentIntent(pendingIntent)
.setDefaults(Notification.DEFAULT_SOUND)
.setAutoCancel(true)
.setSmallIcon(R.drawable.ic_launcher)
.build();
Get inside your favorite movies with Google Play
“What’s his name again? Wasn’t he the guy in that movie with the battle of the bands?” Now, while you're watching a movie on Google Play, you can find out that it’s Jack Black (of course!), who was born in Hermosa Beach and is 43 years old. And with one click you can search the web and learn the fun fact that his parents are both rocket scientists.
We’ve added info cards to the Google Play Movies & TV app so you can easily learn more about the actors, related films and even what song is playing in many of your favorite movies. When you’re watching a film on your tablet, simply press pause and cards will pop up with information about actors on screen. You can tap on an actor’s face to learn more about him, like his age, place of birth, his character in the movie, and his recent work, or scroll through the info cards to learn more about the movie or soundtrack. When you resume the movie, the cards will disappear.
This new feature is offered for hundreds of movies in Google Play and we’re adding more every day. If you’re in the U.S. and have a tablet running Android 4.0 (Ice Cream Sandwich) and higher, download the latest version of the Google Play Movies & TV app to check it out. We hope to bring info cards to more movies in more countries and devices soon.
Posted by Ben Serridge, Product Manager for Google Play
We’ve added info cards to the Google Play Movies & TV app so you can easily learn more about the actors, related films and even what song is playing in many of your favorite movies. When you’re watching a film on your tablet, simply press pause and cards will pop up with information about actors on screen. You can tap on an actor’s face to learn more about him, like his age, place of birth, his character in the movie, and his recent work, or scroll through the info cards to learn more about the movie or soundtrack. When you resume the movie, the cards will disappear.
This new feature is offered for hundreds of movies in Google Play and we’re adding more every day. If you’re in the U.S. and have a tablet running Android 4.0 (Ice Cream Sandwich) and higher, download the latest version of the Google Play Movies & TV app to check it out. We hope to bring info cards to more movies in more countries and devices soon.
Posted by Ben Serridge, Product Manager for Google Play
The World’s Languages in Your Pocket (No Internet Required)
Have you ever found yourself in a foreign country, wishing you knew how to say "I'm lost!" or "I'm allergic to peanuts”? The Internet and services like Google Translate can help—but what if you don't have a connection?
Today we're launching offline language packages for Google Translate on Android (2.3 and above) with support for fifty languages, from French and Spanish to Chinese and Arabic.
You can select [Offline Languages] in the app menu to see all the offline language packages available for download. To enable offline translation between any two languages, you just need to select them in the offline languages menu. Once the packages are downloaded, you're good to go.
While the offline models are less comprehensive than their online equivalents, they are perfect for translating in a pinch when you are traveling abroad with poor reception or without mobile data access.
So go out and explore another language or another culture without worrying about Internet access. There’s a whole world offline out there.
Posted by Minqi Jiang, Associate Product Manager
Alfa Romeo 4C Launch Edition
S4 / 1.742 cc / 240 PS / 258 ft/lb (350 Nm) / turbo / 0 - 62 mph (100 km/h): 4,5 s / Vmax: 155 mph (250 km/h) / Limited edition (1000 cars)
(click images for a larger view)
![](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_sXk0Lla2YtY5ZQIrCT-LLJXuiNc0wVauJ8MwnUzxgICmsN6usEGupNMFvA8U2rVXUcwKRFqqjlOB6QzFBl5bdlUoWDFinXNFpoOIgSqC_Mb1g2CxLTXE51KcmEYeoyxt4dPOeE8g=s0-d)
![](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_sWKraCbzcl3n9KKEYA0Kb4SnpVMsA7WWAO-nDUkN06W5zHfoMZdigGMb4v-yDzAZPUaSiRZ3X2F9YDgGyaqaQttS0IEBMxMf9175xnNWJWjwkiE-4kTylzgb8zLnn1b5KQ5xLx=s0-d)
![](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_s7KFMx4FNJp5UBsJjhv1H2bC8ud2cpPcAVG6p8SlP_GZmeHyUASgy63k4jJBhifnewu8IliC7ZLbG3gU0ZF4TrSKlMBhNpwiDXt0WBy8FxVN0RlIsgIZ9NmhMhDYUZ3WstnZr-Jw=s0-d)
![](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tBsYzFSvOUrftrMpsn20-WRGxFAwUhAibEzhYOrQubq68OVigAoq366cfdner786Anky3pupNGt8TMPxCeDHU-eQyAAt5PRuC9aiQNeMlS82RrxHTDXc2ypzJ5X2wXIpyv=s0-d)
![](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_usUTZRPIyk9Ay7OO8386YzBnhoaTqseTmqBB9uyJ3whpb7H77x5HcBNmYvER81tQw8bS5d9WRtOV7ipptcgTP4jFpmGFBJabNA6g0vaynngdwCXctKNvHs9ioIH-ZRcy7F5oDh4A=s0-d)
![](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_v0HcTPCISuH44EQeRwoPwuKVPyd5MKx9c7j_KyIadd_wwsP72iB4ibWO9L5d7sKJRYDMSOA7fFnuQFNo1TR7yRFybUlMMwRyuchyfHgv-rDtuDPnpj7JcLil1s-PyWHOhAWt8S6A=s0-d)
![](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uxepj7a4N8mzFPZ10prP5VKGDIqYjNgw2Y1Pr1_eQih03Mhz7oO_NQ3T7zjZGBMV_VJKa498if7o6gyqnETmQk2F0CEi6kIZSVIwFW_Mi1ggQPbz5XrjIKeN2ylXHhNGmFqDYvtQ=s0-d)
![](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_u0wIhw1rn7UqMbiW4QOr8ilRQxXkwmGUS-VJpWxUnqCIxQ3vOk-__2fDrUBoA6kNO6jANfiL9EmKJfzEmjArz7LoBnsQy6GY7GZbSgUa-W_Vok19RuyV5aRAwGBR3AscpPJ0H_IbwG=s0-d)
![](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_sAPqs8MZEWKSi0_sn3AiJjjGLJGUnByMsSOWjggWgw9L1ZfoIqoF3K0VFUaa3tucvkkl5IDciXVkerr0uC9O0qMt72y0495RpbOaTPWTMJ0t4fsu3hIztrUy_cxCPHd80YyGKj-A=s0-d)
(click images for a larger view)
error of using NotificationCompat.Builder, IllegalArgumentException: contentIntent required
Refer to the exercise "Example of using NotificationCompat.Builder"; if the statement of new NotificationCompat.Builder...build() modified to remove .setContentIntent(pendingIntent), error of java.lang.IllegalArgumentException: contentIntent required MAY be thrown.
It will have no error in compile time, and no error when run on HTC One X (Android 4.1.1) and HTC Fly (Android 3.2.1). But error when run on Nexus One (Android 2.3.6), with error:
03-27 21:33:40.631: D/AndroidRuntime(24248): Shutting down VM
03-27 21:33:40.631: W/dalvikvm(24248): threadid=1: thread exiting with uncaught exception (group=0x40015560)
03-27 21:33:40.651: E/AndroidRuntime(24248): FATAL EXCEPTION: main
03-27 21:33:40.651: E/AndroidRuntime(24248): java.lang.IllegalArgumentException: contentIntent required: pkg=com.example.androidnotificationbuilder id=1 notification=Notification(vibrate=null,sound=default,defaults=0x1,flags=0x10)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.os.Parcel.readException(Parcel.java:1326)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.os.Parcel.readException(Parcel.java:1276)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.app.INotificationManager$Stub$Proxy.enqueueNotificationWithTag(INotificationManager.java:274)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.app.NotificationManager.notify(NotificationManager.java:111)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.app.NotificationManager.notify(NotificationManager.java:91)
03-27 21:33:40.651: E/AndroidRuntime(24248): at com.example.androidnotificationbuilder.MainActivity$1.onClick(MainActivity.java:52)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.view.View.performClick(View.java:2485)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.view.View$PerformClick.run(View.java:9080)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.os.Handler.handleCallback(Handler.java:587)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.os.Handler.dispatchMessage(Handler.java:92)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.os.Looper.loop(Looper.java:130)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.app.ActivityThread.main(ActivityThread.java:3683)
03-27 21:33:40.651: E/AndroidRuntime(24248): at java.lang.reflect.Method.invokeNative(Native Method)
03-27 21:33:40.651: E/AndroidRuntime(24248): at java.lang.reflect.Method.invoke(Method.java:507)
03-27 21:33:40.651: E/AndroidRuntime(24248): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-27 21:33:40.651: E/AndroidRuntime(24248): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-27 21:33:40.651: E/AndroidRuntime(24248): at dalvik.system.NativeStart.main(Native Method)
If you want no action perform when user click on the Notification, you can create a PendingIntent with empty Intent for Notification to do nothing.
It will have no error in compile time, and no error when run on HTC One X (Android 4.1.1) and HTC Fly (Android 3.2.1). But error when run on Nexus One (Android 2.3.6), with error:
03-27 21:33:40.631: D/AndroidRuntime(24248): Shutting down VM
03-27 21:33:40.631: W/dalvikvm(24248): threadid=1: thread exiting with uncaught exception (group=0x40015560)
03-27 21:33:40.651: E/AndroidRuntime(24248): FATAL EXCEPTION: main
03-27 21:33:40.651: E/AndroidRuntime(24248): java.lang.IllegalArgumentException: contentIntent required: pkg=com.example.androidnotificationbuilder id=1 notification=Notification(vibrate=null,sound=default,defaults=0x1,flags=0x10)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.os.Parcel.readException(Parcel.java:1326)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.os.Parcel.readException(Parcel.java:1276)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.app.INotificationManager$Stub$Proxy.enqueueNotificationWithTag(INotificationManager.java:274)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.app.NotificationManager.notify(NotificationManager.java:111)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.app.NotificationManager.notify(NotificationManager.java:91)
03-27 21:33:40.651: E/AndroidRuntime(24248): at com.example.androidnotificationbuilder.MainActivity$1.onClick(MainActivity.java:52)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.view.View.performClick(View.java:2485)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.view.View$PerformClick.run(View.java:9080)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.os.Handler.handleCallback(Handler.java:587)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.os.Handler.dispatchMessage(Handler.java:92)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.os.Looper.loop(Looper.java:130)
03-27 21:33:40.651: E/AndroidRuntime(24248): at android.app.ActivityThread.main(ActivityThread.java:3683)
03-27 21:33:40.651: E/AndroidRuntime(24248): at java.lang.reflect.Method.invokeNative(Native Method)
03-27 21:33:40.651: E/AndroidRuntime(24248): at java.lang.reflect.Method.invoke(Method.java:507)
03-27 21:33:40.651: E/AndroidRuntime(24248): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-27 21:33:40.651: E/AndroidRuntime(24248): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-27 21:33:40.651: E/AndroidRuntime(24248): at dalvik.system.NativeStart.main(Native Method)
If you want no action perform when user click on the Notification, you can create a PendingIntent with empty Intent for Notification to do nothing.