There are several buttons in my app. New activity starts quickly whenever i press any button except for one. It lags to open a new activity.Why it is lagging ? Here is the code snipet :
Intent intent = new Intent(this, ChooseActivity.class);
startActivityForResult(intent, Constant.MP_REQUEST);
ChooseActivity.class:
ChooseActivityHelper mActivityHelper;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
mActivityHelper = new ChooseActivityHelper(this);
mActivityHelper.inflateView();
}
ChooseActivityHelper:
public ChooseActivityHelper(Context ctx) {
mCurrentTabIndex = 1;
mContext = ctx;
}
// inflate data to view
@SuppressLint("UseSparseArrays")
public void inflateView() {
ChooseActivity act = (ChooseActivity) mContext;
try {
assMngr = act.getAssets();
String[] folders = assMngr.list(Constant._FOLDER);
for (String f : folders) {
inflateTabView(f);
stampFolderList.add(f);
}
} catch (IOException e) {
e.printStackTrace();
}
}