Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

Commit

Permalink
Changing language from MainActivity crash fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
khobaib committed Apr 24, 2014
1 parent c3549cd commit 5310182
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ public class PageLanguageSettingsAdapter extends ArrayAdapter<PageAction> {
private String selectedLang;
private int lastUpdatedVersion;
private int latestVersion;
private int parentActivity;

public PageLanguageSettingsAdapter(Context context) {
public PageLanguageSettingsAdapter(Context context, int parentActivity) {
super(context, R.layout.row_page_language_settings);
this.mContext = context;
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.currentLang = ApplicationSettings.getSelectedLanguage(mContext);
latestVersion = -1;
lastUpdatedVersion = ApplicationSettings.getLastUpdatedVersion(mContext);
this.parentActivity = parentActivity;
}


Expand Down Expand Up @@ -117,6 +119,9 @@ public void restartApp(){
i.putExtra("page_id", pageId);
mContext.startActivity(i);

if(parentActivity == AppConstants.FROM_WIZARD_ACTIVITY){
((WizardActivity) mContext).callFinishActivityReceiver();
}
((Activity) mContext).finish();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void onActivityCreated(Bundle savedInstanceState) {
tvIntro.setText(currentPage.getIntroduction());


pageLanguageSettingsAdapter = new PageLanguageSettingsAdapter(activity);
pageLanguageSettingsAdapter = new PageLanguageSettingsAdapter(activity, parentActivity);
lvActions.setAdapter(pageLanguageSettingsAdapter);

pageLanguageSettingsAdapter.setData(currentPage.getAction());
Expand Down

0 comments on commit 5310182

Please sign in to comment.