arrayList items in many classes
<p>I want to use values from ArrayList exist in Class2 into activity1 the values parsing from a webservice in the class2 and save them in the array I defined object from class2 into activity1 but the ther's a problem when open the activity1 the app stopped so how can i solve thsis probem<br>
??</p>

<p>class2:</p>

<pre><code> ArrayList&lt;String&gt; links=new ArrayList&lt;String&gt;();
 ArrayList&lt;String&gt; names=new ArrayList&lt;String&gt;();
</code></pre>

<p>activity1:</p>

<pre><code>baka bk=new baka();
if(bk.links.get(1).equals("2")){
Intent i=new Intent(mContext,Activity2.class);
startActivity(i);
}else{
return  ;}
</code></pre>

<p>logcat</p>

<pre><code>09-26 11:51:33.630: E/AndroidRuntime(1383): java.lang.NullPointerException
09-26 11:51:33.630: E/AndroidRuntime(1383):     at com.university.app.PersonalHome$1.onItemClick(PersonalHome.java:54)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at com.university.app.controls.CarouselAdapter.performItemClick(CarouselAdapter.java:261)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at com.university.app.controls.Carousel.onSingleTapUp(Carousel.java:964)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.GestureDetector.onTouchEvent(GestureDetector.java:568)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at com.university.app.controls.Carousel.onTouchEvent(Carousel.java:310)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.View.dispatchTouchEvent(View.java:5541)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1951)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1712)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1912)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.app.Activity.dispatchTouchEvent(Activity.java:2364)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1860)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2890)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2466)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
09-26 11:51:33.630: E/AndroidRuntime(1383):     at dalvik.system.NativeStart.main(Native Method)
09-26 11:53:21.141: E/UNIVERSITY(1436): Size of List Before 0
</code></pre>
