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.