उदाहरण roboguice का उपयोग करके नहीं डाला जा सकता है।
यह कोड क्लासकास्ट अपवाद प्राप्त करता है।java.lang.ClassCastException: android.app. आवेदन को roboguice.application.RoboApplication
public class MainActivity extends RoboActivity{
@InjectView(R.id.text)
TextView name;
@InjectView(R.id.imageView1)
ImageView imageView;
Drawable icon;
@InjectResource(R.string.app_name)
String myName;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
सभी जार फ़ाइलें पहले से ही शामिल हैं।
मेरे Manifest.xml यहाँ है ..
इस यहाँ पाते हैं।
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.roboguice"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.roboguice.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>
manifest.xml में कोई बदलाव नहीं। यदि आवश्यक हो तो कहें।
अपने Manifest.xml पोस्ट करें –
@ बिराजजलावाडिया मैंने manifest.xml –
@ बिराजजलावाडिया कार्यरत आवेदन, धन्यवाद। –