2

i have read this thread and some others on stackoverflow but my problem seem not to be fix yet.

Below is a snippet from my code: (the manifest file.xml)

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.eightbitcloud.example.widget"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="4"
        android:targetSdkVersion="11" />

    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name" >
        <activity
            android:name=".WidgetExampleActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

                <action android:name="com.eightbitcloud.example.widget.ACTION_WIDGET_CONFIGURE" />
            </intent-filter>
        </activity>

        <receiver
            android:name=".ExampleAppWidgetProvider"
            android:label="@string/widget1name" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
                <action android:name="com.eightbitcloud.example.widget.ACTION_WIDGET_RECEIVER" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/widget1_info" />
        </receiver>
    </application>

</manifest>

and also: MainActivity.java as WidgetExampleActivity.java

public class WidgetExampleActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        sendBroadcast(new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME));
        setContentView(R.layout.main);
    }
}

and /res/xml/widget_info.xml

<?xml version="1.0" encoding="utf-8"?>
    <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" 
    android:minWidth="294dp"
    android:minHeight="72dp"
    android:updatePeriodMillis="10000"
    android:initialLayout="@layout/widget1"
    >
</appwidget-provider>

The problem is that the widget appear on android version <= 4.1 but it does not appear on my android >=4.2. I got to know this because i tested it on different device. Please, how do i fix this problem.

Community
  • 1
  • 1
Belvi Nosakhare
  • 3,107
  • 5
  • 32
  • 65

1 Answers1

0

Somewhat you targeted upperlimit of android OS at api level 11..set it at 19 to get rest of the android OS targets at 4.x

Fred Grott
  • 3,505
  • 1
  • 23
  • 18