Lets say i have a listview as my main activity.On clicking an item it opens up a second activity.On clicking a button it opens a custom listview using volley library from this tutorial if you are following(http://www.androidhive.info/2014/07/android-custom-listview-with-image-and-text-using-volley/) However on clicking the button in the second activity to open my listview with volley,my app stops. The problem i figured started in the manifest as i'll post below. I have two Application classes as i am using Parse push notification library.But however only one application can be declared to open on startup in the manifest.So i implemented the answer on this question(how to handle multiple application classes in android) .It was after this that my app kept stopping when opening the third activity. So please help me achieve this.Thanks in advance.
Manifest snippet
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.stevekamau.snapt"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name="com.stevekamau.snapt.ParseApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<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>
..............</activity>
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
</application>
</manifest>
I modified the AppController class from here(http://www.androidhive.info/2014/07/android-custom-listview-with-image-and-text-using-volley/ ) to extend ParseApplication
public class AppController extends ParseApplication {
public static final String TAG = AppController.class.getSimpleName();
private RequestQueue mRequestQueue;
private ImageLoader mImageLoader;
private static AppController mInstance;
@Override
public void onCreate() {
super.onCreate();
mInstance = this;
}
public static synchronized AppController getInstance() {
return mInstance;
}
public RequestQueue getRequestQueue() {
if (mRequestQueue == null) {
mRequestQueue = Volley.newRequestQueue(getApplicationContext());
}
return mRequestQueue;
}
public ImageLoader getImageLoader() {
getRequestQueue();
if (mImageLoader == null) {
mImageLoader = new ImageLoader(this.mRequestQueue,
new LruBitmapCache());
}
return this.mImageLoader;
}
public <T> void addToRequestQueue(Request<T> req, String tag) {
// set the default tag if tag is empty
req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
getRequestQueue().add(req);
}
public <T> void addToRequestQueue(Request<T> req) {
req.setTag(TAG);
getRequestQueue().add(req);
}
public void cancelPendingRequests(Object tag) {
if (mRequestQueue != null) {
mRequestQueue.cancelAll(tag);
}
}
}
If you need more code please let me know.
log cat:
11-21 16:20:29.916: E/Trace(26640): error opening trace file: No such file or directory (2)
11-21 16:20:29.936: W/dalvikvm(26640): Refusing to reopen boot DEX '/system/framework/hwframework.jar'
11-21 16:20:30.046: W/System.err(26640): Invalid int: ""
11-21 16:20:30.386: I/Adreno200-EGL(26640): <qeglDrvAPI_eglInitialize:299>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_JB_REL_2.0.3.04.01.01.21.010_msm8625_JB_REL_2.0.3_Merge_release_AU (Merge)
11-21 16:20:30.386: I/Adreno200-EGL(26640): Build Date: 10/26/12 Fri
11-21 16:20:30.386: I/Adreno200-EGL(26640): Local Branch:
11-21 16:20:30.386: I/Adreno200-EGL(26640): Remote Branch: quic/jb_rel_2.0.3
11-21 16:20:30.386: I/Adreno200-EGL(26640): Local Patches: NONE
11-21 16:20:30.386: I/Adreno200-EGL(26640): Reconstruct Branch: AU_LINUX_ANDROID_JB_REL_2.0.3.04.01.01.21.010 + NOTHING
11-21 16:20:37.636: W/dalvikvm(26640): threadid=1: thread exiting with uncaught exception (group=0x40e08438)
11-21 16:20:49.016: E/Trace(26711): error opening trace file: No such file or directory (2)
11-21 16:20:49.036: W/dalvikvm(26711): Refusing to reopen boot DEX '/system/framework/hwframework.jar'
11-21 16:20:49.096: W/System.err(26711): Invalid int: ""