从android中的子项目打开活动

时间:2017-06-20 12:42:27

标签: android android-activity

我有一个项目库,其中有一些逻辑需要打开基于此库的应用程序的活动

我无法将应用程序添加为依赖项,因此我如何能够打开活动,请任何人建议

BaseApplication.java

public class BaseApplication extends Application {

@Override
    public void onCreate() {

        super.onCreate();
        BaseApplication.mInstance = this;

        // Register global exception handler.
        UncoughtException crashHandler = UncoughtException.getInstance();
        crashHandler.init(getApplicationContext());
    }
}

UncoughtException.java

public class UncoughtException implements UncaughtExceptionHandler {

@Override
    public void uncaughtException(Thread thread, Throwable ex) {
        ex.printStackTrace();

        intent = new Intent(mContext, UncoughtExceptionActivity.class);
        mContext.startActivity(intent);

    }
}

UncoughtExceptionActivity.java

public class UncoughtExceptionActivity extends Activity {

mReopenButton.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

ntent intent = new Intent(UncoughtExceptionActivity.this , SplashActivity.class);
UncoughtExceptionActivity.this.startActivity(intent);
        }
    }

}

在基本模块中找不到SplashActivity,它位于另一个模块中,我想从当前模块中打开它

0 个答案:

没有答案