android应用程序与maven构建工具显示错误

时间:2014-11-12 05:50:42

标签: java android maven

我用maven构建工具创建了我的android应用程序..

在我的应用中, 的 ViewPagerStyle1Activity

public class ViewPagerStyle1Activity extends FragmentActivity {
private ViewPager _mViewPager;
private ViewPagerAdapter _adapter;
private Button _btn1,_btn2;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    setUpView();
    setTab();
}
private void setUpView(){       
 _mViewPager = (ViewPager) findViewById(R.id.viewPager);
 _adapter = new ViewPagerAdapter(getApplicationContext(),getSupportFragmentManager());
 _mViewPager.setAdapter(_adapter);
 _mViewPager.setCurrentItem(0);
 initButton();
}
    private void setTab(){
        _mViewPager.setOnPageChangeListener(new OnPageChangeListener(){
                @Override
                    public void onPageScrollStateChanged(int position) {}
                @Override
                    public void onPageScrolled(int arg0, float arg1, int arg2) {}
                @Override
                    public void onPageSelected(int position) {
                        // TODO Auto-generated method stub
                        btnAction(position);
                    }                       
                });
}
private void btnAction(int action){
    switch(action){
      case 0: setButton(_btn1,"1",40,40); setButton(_btn2,"",20,20);break;
      case 1: setButton(_btn2,"2",40,40); setButton(_btn1,"",20,20); break;
    }
}
private void initButton(){
    _btn1= (Button)findViewById(R.id.btn1);
    _btn2= (Button)findViewById(R.id.btn2);
    setButton(_btn1,"1",40,40);
    setButton(_btn2,"",20,20);   
}
 private void setButton(Button btn,String text,int h, int w){
    btn.setWidth(w);
    btn.setHeight(h);
    btn.setText(text);
}}

我使用终端的maven构建工具创建了项目。 我的申请表中没有红十字标志。

但Maven预计会出现以下错误: -

FATAL EXCEPTION: main
Process: com.arijit.info, PID: 5593
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.arijit.info
com.arijit.info.ViewPagerStyle1Activity}: java.lang.ClassNotFoundException: Didn't find class
"com.arijit.info.ViewPagerStyle1Activity" on path: DexPathList[[zip file "/data/app
com.arijit.info-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.arijit.info-2, /vendor/lib, /system/lib]]

0 个答案:

没有答案