I developed a android homescreen, the code seems right but when I run the project I get the following error:
java.lang.RuntimeException:
Unable to instantiate activity ComponentInfo{com.matthieu.launcher/
com.matthieu.launcher.DragableSpace}:
java.lang.InstantiationException: com.matthieu.launcher.DragableSpace
Here is the complete log: http://pastebin.com/iYtYW2W6
The code is straight from the Android Launcher.
DragableSpace: http://pastebin.com/jpWDtFPF
MainActivity:
public class MainActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
DragableSpace space = new DragableSpace(this.getApplicationContext());
setContentView(space);
}
}
attr.xml in values folder:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="DragableSpace">
<attr name="default_screen" format="integer"/>
</declare-styleable>
</resources>
Three xml files initial_screen, left_screen and right_screen, all have same code apart from the id:
<LinearLayout android:id="@+id/center"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
</LinearLayout>
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.matthieu.launcher"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".MainActivity"
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>
</manifest>
Any ideas how to fix that?