You can open your Activity from applozic's ui module using the following ways:
1) Launch the activity directly using its name:
try{
String activityName = "YourActivityName";
Class activityToOpen = Class.forName(activityName);
Intent intent = new Intent(this, activityToOpen);
startActivity(intent);
}catch(ClassNotFoundException e){
}
2) Create an interface in mobicomkitui's uilistener package with a call method:
package com.applozic.mobicomkit.uiwidgets.uilistener;
import android.content.Context;
public interface AlActionCallback {
void onAction(Context context, String action, Object object);
}
Call the interface method on press of a button or something, from where you want to launch the activity
onClick(){
((AlActionCallback) getActivity().getApplication()).onAction(getContext(), "startMyActivity", SomeObject);
}
Implement this interface in your Application class:
public class MyApplication extends MultiDexApplication implements AlActionCallback {
@Override
public void onCreate() {
super.onCreate();
}
@Override
public void onAction(Context context, String action, Object object) {
if(action != null){
switch (action){
case "startMyActivity" :
SomeObject obj = (SomeObject) object;
Intent intent = new Intent(context, YourActivity.class);
intent.putExtra("someData",obj.getSomething());
startActivity(intent);
break;
}
}
}
}