Skip to content

Commit

Permalink
fix `java.lang.RuntimeException: Unable to start activity ComponentIn…
Browse files Browse the repository at this point in the history
…fo{org.medicmobile.webapp.mobile/org.medicmobile.webapp.mobile.EmbeddedBrowserActivity}: android.app.Fragment$InstantiationException: Unable to instantiate fragment org.medicmobile.webapp.mobile.OpenSettingsDialogFragment: could not find Fragment constructor`
  • Loading branch information
m5r committed May 28, 2024
1 parent 02d0bfc commit 25b501e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void onReceiveValue(String result) {

getFragmentManager()
.beginTransaction()
.add(new OpenSettingsDialogFragment(container), OpenSettingsDialogFragment.class.getName())
.add(new OpenSettingsDialogFragment(), OpenSettingsDialogFragment.class.getName())
.commit();

configureUserAgent();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.medicmobile.webapp.mobile;

import static org.medicmobile.webapp.mobile.MedicLog.trace;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Fragment;
Expand All @@ -16,7 +18,7 @@
@SuppressLint("ValidFragment")
public class OpenSettingsDialogFragment extends Fragment {

private final View view;
private View view;
private int fingerTapCount = 0;
private long lastTimeTap = 0;
private GestureHandler swipeGesture;
Expand All @@ -32,14 +34,11 @@ public boolean onTouch(View view, MotionEvent event) {
}
};

public OpenSettingsDialogFragment(View view) {
this.view = view;
}

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
view.setOnTouchListener(onTouchListener);
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
this.view = view.findViewById(R.id.wbvMain);
this.view.setOnTouchListener(onTouchListener);
}

private void countTaps(MotionEvent event) {
Expand Down

0 comments on commit 25b501e

Please sign in to comment.