Auto logout after payment done on Paypal android

Hi Guys, While working on Paypal Android Sdk 2.3.5v, integration in to an app. I’ve come across a situation, that app should log out from Paypal screens, after payment is done and return to app screens.

Here is the code snippet to implement that feature

private static PayPalConfiguration config = new PayPalConfiguration()

In this above for rememberUser(boolean) method of PayPalConfiguration object will make turn On/Off for Auto logout feature.

Paypal Android

here is ref link

Hope it helps somebody :).

Get resource Id of Image in drawable folder

Image in drawable folder

Hi Guys, At times we need to get  resource id of Image in drawable folder to dynamically assign the resource Id to Imageview…

here is code snippet to get resource Id of image..

public int getImageResourceID(Context context, String imageName) {
     int resId = context.getResources().getIdentifier(imageName, "drawable", "com.mypackage.namehere");
     return resId;

hope it helps somebody

Display Animated Gif Image, Android

Recently, I’ve worked displaying Animated Gif Image as while loading some network stuff in app screen.

Solution for displaying the Animated gif image

Gif Image

After some struggle for it, I finally happen to use Webview for displaying the Animated gif image which worked as required.

Here is simple code snippet

I place this WebView in a RelativeLayout

<WebView android:id=”@+id/webviewSpinner” 
android:visibility=”invisible” >

and in Activity, written following code

webviewSpinner=(WebView) findViewById(; 
webviewSpinner.setWebViewClient(new MyWebViewClient()); 
webviewSpinner.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null); 

and in the jave code WebView object loadDataWithBaseURL method, i place htmlString variable, which is a String variable with Html content as below

private String htmlString=”<html><body><table width="100%" height="100%"><tr><td align="center" valign="center"><img src="478_spinner.gif"></td></tr></table></body></html>”;

I just make the WebView visible and invisible while loading data, which worked like a loader.

Hope it helps somebody…

You may be also interested in


HTML Tags Supported By TextView, Android

Following are the Supported HTML Tags by TextView

  • <a href=”…”>
  • <b>
  • <big>
  • <blockquote>
  • <br>
  • <cite>
  • <dfn>
  • <div align=”…”>
  • <em>
  • <font size=”…” color=”…” face=”…”>
  • <h1>
  • <h2>
  • <h3>
  • <h4>
  • <h5>
  • <h6>
  • <i>
  • <img src=”…”>
  • <p>
  • <small>
  • <strike>
  • <strong>
  • <sub>
  • <sup>
  • <tt>
  • <u>


ref link.