How to update Notification with RemoteViews?

Here’s a detail example for you to update the notification using RemoteViews: Layout for the Notification, i.e. res/layout/custom_notification_small.xml: Hope this example helps you a lot! NOTE: You can’t update the custom NotificationCompat on pre-Honeycomb, so I added an alternative way to update it on pre-Honeycomb, i.e. checking the API level first and use the deprecated Notification instead.

RecyclerView vs. ListView

RecyclerView was created as a ListView improvement, so yes, you can create an attached list with ListView control, but using RecyclerView is easier as it: Reuses cells while scrolling up/down – this is possible with implementing View Holder in the ListView adapter, but it was an optional thing, while in the RecycleView it’s the default way of writing adapter. Decouples list from its container – so you can … Read more

How do I get the dialer to open with phone number displayed?

Two ways to achieve it. 1) Need to start the dialer via code, without user interaction. You need Action_Dial, use below code it will open Dialer with number specified The ‘tel:’ prefix is required, otherwhise the following exception will be thrown: java.lang.IllegalStateException: Could not execute method of the activity. Action_Dial doesn’t require any permission. If you want … Read more

Android – setOnClickListener vs OnClickListener vs View.OnClickListener

The logic is simple. setOnClickListener belongs to step 2. You create the button You create an instance of OnClickListener* like it’s done in that example and override the onClick-method. You assign that OnClickListener to that button using btn.setOnClickListener(myOnClickListener); in your fragments/activities onCreate-method. When the user clicks the button, the onClick function of the assigned OnClickListener is called. *If you import android.view.View; you use View.OnClickListener. If you import android.view.View.*; or import android.view.View.OnClickListener; you use OnClickListener as far as … Read more

adb shell su works but adb root does not

By design adb root command works in development builds only (i.e. eng and userdebug which have ro.debuggable=1 by default). So to enable the adb root command on your otherwise rooted device just add the ro.debuggable=1 line to one of the following files: If you want adb shell to start as root by default – then add ro.secure=0 as well. Alternatively you could use modified adbd binary (which does not check for ro.debuggable) From https://android.googlesource.com/platform/system/core/+/master/adb/daemon/main.cpp

How can I use adb over WiFi?

Connect Android phone and host machine to same WiFi network Connect Android phone to host machine using USB cable (to start with) Run adb tcpip 5555 from a command prompt Run adb shell “ip addr show wlan0 | grep -e wlan0$ | cut -d\” \” -f 6 | cut -d/ -f 1″ to obtain the phone’s IP address Disconnect USB cable … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)