How to give path in Android
-
I'm trying to display gif images on Android. This is my code to display a.gif :
WebView wView = new WebView(this); wView.loadUrl("android.resource://" + getPackageName() + "/" + R.drawable.a); setContentView(wView);
But I get this : The webpage at android.resource://com.example.mypc.myapp/2497475928917 could not be loaded because : net::ERR_UNKNOWN_URL_SCHEME My gif files are in drawable and raw folder under res folder. Can you tell me how to give paths of gifs correctly? Thanks in advance.
-
I'm trying to display gif images on Android. This is my code to display a.gif :
WebView wView = new WebView(this); wView.loadUrl("android.resource://" + getPackageName() + "/" + R.drawable.a); setContentView(wView);
But I get this : The webpage at android.resource://com.example.mypc.myapp/2497475928917 could not be loaded because : net::ERR_UNKNOWN_URL_SCHEME My gif files are in drawable and raw folder under res folder. Can you tell me how to give paths of gifs correctly? Thanks in advance.
Animated GIF, or just a single image? Lots of suggestions here.
jasonalien wrote:
wView.loadUrl("android.resource://" + getPackageName() + "/" + R.drawable.a);
This should probably be:
wView.loadUrl("file:///android_asset/a.gif");
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
I'm trying to display gif images on Android. This is my code to display a.gif :
WebView wView = new WebView(this); wView.loadUrl("android.resource://" + getPackageName() + "/" + R.drawable.a); setContentView(wView);
But I get this : The webpage at android.resource://com.example.mypc.myapp/2497475928917 could not be loaded because : net::ERR_UNKNOWN_URL_SCHEME My gif files are in drawable and raw folder under res folder. Can you tell me how to give paths of gifs correctly? Thanks in advance.
-
I'm trying to display gif images on Android. This is my code to display a.gif :
WebView wView = new WebView(this); wView.loadUrl("android.resource://" + getPackageName() + "/" + R.drawable.a); setContentView(wView);
But I get this : The webpage at android.resource://com.example.mypc.myapp/2497475928917 could not be loaded because : net::ERR_UNKNOWN_URL_SCHEME My gif files are in drawable and raw folder under res folder. Can you tell me how to give paths of gifs correctly? Thanks in advance.
myVideoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.introvideo));