Here is my code, but still crush my android, and get an Error
package irdc.ex03_18;
import java.io.IOException;
import java.io.InputStream;
import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
public class EX03_18 extends Activity
{
protected static InputStream bg01;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources resources = getBaseContext().getResources();
bg01 = resources.openRawResource(R.drawable.gta4boxart);
try
{
setWallpaper(bg01);
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="irdc.ex03_18"
android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/icon" android:label="@string/
app_name">
<activity android:name=".EX03_18"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.SETWALLPAPER"/>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
how can I change my Android wallpaper???
On 11月3日, 上午7時02分, Roman_Romano <[email protected]> wrote:
> add to your AdroidManifest.xml:
>
> <uses-permission android:name="android.permission.SETWALLPAPER"></uses-
> permission>
>
> should do it
>
> regards
>
> On Nov 2, 10:56 pm, joshbeck <[email protected]> wrote:
>
> > Thank you very much.
> > I'll look it up.
>
> > Much appreciated.
>
> > prospero
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---