public BookItemAdapter(Context context,ListView listView){ mInflater = LayoutInflater.from(context); syncImageLoader = new SyncImageLoader(); mContext = context; mListView = listView;
ma=new MainActivity(); mListView.setOnScrollListener(onScrollListener); mListView.setOnItemClickListener(new OnItemClickListener() {//点击item事件 @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { System.out.println("position is:" + arg2); //startImagePagerActivity(arg2); ma.changeActivity(arg2,mContext); } }); }忘了粘这个代码了!还是不行啊,求指点
最新的错误,可是AndroidManifest里面我定义了ImagePagerActivity!就在上面帖子里,写的不对嘛?! android.content.ActivityNotFoundException: Unable to find explicit activity class {/com.example.viper.ImagePagerActivity}; have you declared this activity in your AndroidManifest.xml?
java.lang.NullPointerException
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
是不是必须得在Activity里调用?!
System.out.println("arg2----:" + arg2);
Intent intent = new Intent(context, ImagePagerActivity.class);
System.out.println("+++ok");
context.startActivity(intent);
}
private LayoutInflater mInflater;
private Context mContext;
private Vector<BookModel> mModels = new Vector<BookModel>();
private ListView mListView;
SyncImageLoader syncImageLoader;
MainActivity ma;
public BookItemAdapter(Context context,ListView listView){
mInflater = LayoutInflater.from(context);
syncImageLoader = new SyncImageLoader();
mContext = context;
mListView = listView;
ma=new MainActivity();
mListView.setOnScrollListener(onScrollListener);
mListView.setOnItemClickListener(new OnItemClickListener() {//点击item事件 @Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
System.out.println("position is:" + arg2);
//startImagePagerActivity(arg2);
ma.changeActivity(arg2,mContext);
} });
}忘了粘这个代码了!还是不行啊,求指点
android.content.ActivityNotFoundException: Unable to find explicit activity class {/com.example.viper.ImagePagerActivity}; have you declared this activity in your AndroidManifest.xml?