Having trouble linking custom MyWebView with main.xml - android-webview

I have attempted to extend the WebView class in my application so that I can detect swipes:
public class BookOne extends Activity {
public static final String LOG_TAG = "BookOne";
private MyWebView browser;
private WebView listing_area;
private GestureDetector detector;
public class MyWebView extends WebView {
GestureDetector gd;
public MyWebView(Context context, AttributeSet attributes) {
super(context, attributes);
this.
gd = new GestureDetector(new SwipeDetector());
}
#Override
public boolean onTouchEvent(MotionEvent event) {
Log.v(LOG_TAG, "onTouchEvent 2");
return (gd.onTouchEvent(event) || super.onTouchEvent(event));
}
};
In my main.xml file I've referenced MyWebView as follows:
<mikes.BookOne.BookOne.MyWebView
android:layout_below="#+id/linearLayout1"
android:id="#+id/webkit"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_weight="1" />
where I believe that mikes.BookOne.BookOne.MyWebView is the fully qualified path to the new class type.
Unfortunately, I'm getting errors in the LogCat window when I try to run it:
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): FATAL EXCEPTION: main
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): java.lang.RuntimeException: Unable to start activity ComponentInfo{mikes.BookOne/mikes.BookOne.BookOne}:android.view.InflateException: Binary XML file line #62: Error inflating class mikes.BookOne.BookOne.MyWebView
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1815)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.app.ActivityThread.access$500(ActivityThread.java:122)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.os.Handler.dispatchMessage(Handler.java:99)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.os.Looper.loop(Looper.java:132)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.app.ActivityThread.main(ActivityThread.java:4123)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at java.lang.reflect.Method.invokeNative(Native Method)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at java.lang.reflect.Method.invoke(Method.java:491)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at dalvik.system.NativeStart.main(Native Method)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): Caused by: android.view.InflateException: Binary XML file line #62: Error inflating class mikes.BookOne.BookOne.MyWebView
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:682)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.view.LayoutInflater.rInflate(LayoutInflater.java:724)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.view.LayoutInflater.inflate(LayoutInflater.java:347)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:223)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.app.Activity.setContentView(Activity.java:1786)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at mikes.BookOne.BookOne.onCreate(BookOne.java:192)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.app.Activity.performCreate(Activity.java:4397)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): ... 11 more
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): Caused by: java.lang.ClassNotFoundException: mikes.BookOne.BookOne.MyWebView in loader dalvik.system.PathClassLoader[/data/app/mikes.BookOne-1.apk]
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at java.lang.ClassLoader.loadClass(ClassLoader.java:540)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at java.lang.ClassLoader.loadClass(ClassLoader.java:500)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.view.LayoutInflater.createView(LayoutInflater.java:542)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:671)
07-18 23:14:33.630: ERROR/AndroidRuntime(22630): ... 22 more
and the application aborts on load.
The Layout Inflater errors appear to point to the first line of the XML entry in main.xml, but I don't understand where I've gone wrong. Can anyone help?
Thanks,
MikeS

I eventually worked around this problem by defining a LinearLayout view where I wanted the webview in my XML, and then manually generating the webview in my onCreate code:
ViewGroup wkll = (ViewGroup) findViewById(R.id.webkitLinearLayout);
LinearLayout.LayoutParams tlp =
new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT );
browser = new MyWebView(this);
wkll.addView(browser);
browser.setLayoutParams(tlp);
browser.getSettings().setDefaultFontSize(24);
browser.getSettings().setLoadsImagesAutomatically(true);
browser.getSettings().setSaveFormData(true);
browser.getSettings().setJavaScriptEnabled(true);
browser.getSettings().setSupportMultipleWindows(true);
browser.loadUrl("file:///android_asset/cover.html");
browser was defined as
public MyWebView browser;
near the top of my activity. And the corresponding main.xml includes:
<LinearLayout
android:layout_below="#+id/linearLayout1"
android:id="#+id/webkitLinearLayout"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_weight="1" />
This does exactly what I want, with the downside that I can't see the layout properly in the XML graphical layout.

Related

how to solve FATAL EXCEPTION: AsyncTask #2 in flutter

I am using video_editor package in flutter. When I at debug mode it works and no error but when I release the apk, the apps clash and show the error :
D/flutter-ffmpeg(10753): Getting media information for /data/user/0/com.example.apps/cache/file_picker/Screenrecorder-2021-05-19-15-53-57-515.mp4.
E/AndroidRuntime(10753): FATAL EXCEPTION: AsyncTask #2
E/AndroidRuntime(10753): Process: com.example.apps, PID: 10753
E/AndroidRuntime(10753): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime(10753): at android.os.AsyncTask$4.done(AsyncTask.java:399)
E/AndroidRuntime(10753): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime(10753): at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime(10753): at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime(10753): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(10753): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(10753): at java.lang.Thread.run(Thread.java:919)
E/AndroidRuntime(10753): Caused by: java.lang.UnsatisfiedLinkError: Bad JNI version returned from JNI_OnLoad in "/data/app/com.example.apps-QO20kuBv0uYvExYVArrO7A==/lib/arm64/libmobileffmpeg.so": 0
E/AndroidRuntime(10753): at java.lang.Runtime.loadLibrary0(Runtime.java:1071)
E/AndroidRuntime(10753): at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
E/AndroidRuntime(10753): at java.lang.System.loadLibrary(System.java:1667)
E/AndroidRuntime(10753): at com.arthenica.mobileffmpeg.Config.<clinit>(Unknown Source:148)
E/AndroidRuntime(10753): at com.arthenica.mobileffmpeg.Config.nativeFFprobeExecute(Native Method)
E/AndroidRuntime(10753): at com.arthenica.mobileffmpeg.f.a(Unknown Source:0)
E/AndroidRuntime(10753): at com.arthenica.mobileffmpeg.f.b(Unknown Source:0)
E/AndroidRuntime(10753): at com.arthenica.mobileffmpeg.f.a(Unknown Source:48)
E/AndroidRuntime(10753): at c.b.a.a.c.a(Unknown Source:21)
E/AndroidRuntime(10753): at c.b.a.a.c.doInBackground(Unknown Source:2)
E/AndroidRuntime(10753): at android.os.AsyncTask$3.call(AsyncTask.java:378)
E/AndroidRuntime(10753): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(10753): ... 3 more
Does anyone know how to solve this error?
Please check that all required dependencies are included within "dependencies:" in pubspec.yaml. Dependencies declared inside "dev_dependencies:" are not included in released app
Add the following entries into your proguard-rules.pro file. If you don't have this file you can create and put in app folder.
-keep class com.arthenica.mobileffmpeg.Config {
native <methods>;
void log(long, int, byte[]);
void statistics(long, int, float, float, long , int, double, double);
}
-keep class com.arthenica.mobileffmpeg.AbiDetect {
native <methods>;
}

Flutter app crashes after update on startup in Android

My app is experiencing the crash below:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: tech.vgts.lmes, PID: 4228
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/auth/internal/InternalAuthProvider;
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common##17.0.0:78)
at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common##17.0.0:71)
at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common##17.0.0:468)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:354)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:321)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:305)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common##17.0.0:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1917)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1892)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common##17.0.0:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:6239)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.ClassNotFoundException: com.google.firebase.auth.internal.InternalAuthProvider
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:453) 
at java.lang.Class.forName(Class.java:378) 
at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common##17.0.0:78) 
at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common##17.0.0:71) 
at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common##17.0.0:468) 
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:354) 
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:321) 
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:305) 
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common##17.0.0:53) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1917) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1892) 
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common##17.0.0:47) 
at android.app.ActivityThread.installProvider(ActivityThread.java:6239) 
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722) 
at android.app.ActivityThread.-wrap1(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/internal/InternalTokenProvider;
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:453) 
at java.lang.Class.forName(Class.java:378) 
at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common##17.0.0:78) 
at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common##17.0.0:71) 
at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common##17.0.0:468) 
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:354) 
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:321) 
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:305) 
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common##17.0.0:53) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1917) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1892) 
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common##17.0.0:47) 
at android.app.ActivityThread.installProvider(ActivityThread.java:6239) 
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722) 
at android.app.ActivityThread.-wrap1(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
I changed my dependency from:
firebase_auth:
to:
firebase_auth: 0.11.1

I'm trying to use GridView but the Android Studio notifies this error

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.admin.myapp_withgridview, PID: 2856
android.content.res.Resources$NotFoundException: String resource ID #0x5d75c80
at android.content.res.Resources.getText(Resources.java:299)
at android.support.v7.widget.ResourcesWrapper.getText(ResourcesWrapper.java:52)
at android.widget.TextView.setText(TextView.java:4132)
at com.example.admin.myapp_withgridview.CustomAdapter.getView(CustomAdapter.java:57)
at android.widget.AbsListView.obtainView(AbsListView.java:2347)
at android.widget.GridView.onMeasure(GridView.java:1060)
at android.view.View.measure(View.java:17547)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:727)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:463)
at android.view.View.measure(View.java:17547)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
at android.view.View.measure(View.java:17547)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:389)
at android.view.View.measure(View.java:17547)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
at android.view.View.measure(View.java:17547)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17547)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2615)
at android.view.View.measure(View.java:17547)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2015)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1173)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1379)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Application terminated.
There are many different possible causes for this error. If you provide sample source code, you may get better responses.
In the meantime, this thread looks to have good info on possible causes.

Facebook Messenger SDK for Android: crash when sharing a URL

I need to use the Facebook Messenger SDK in an Android app. I want to send a URL, just as text. Since ShareToMessengerParams is too limited, I was forced to manually construct an intent as shown at https://developers.facebook.com/docs/messenger/android#integration_with_intents:
private static final String EXTRA_PROTOCOL_VERSION = "com.facebook.orca.extra.PROTOCOL_VERSION";
private static final String EXTRA_APP_ID = "com.facebook.orca.extra.APPLICATION_ID";
private static final int PROTOCOL_VERSION = 20150314;
private static final String YOUR_APP_ID = "[YOUR_FACEBOOK_APP_ID]";
private static final int SHARE_TO_MESSENGER_REQUEST_CODE = 1;
...
String mimeType = "text/plain";
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setPackage("com.facebook.orca");
intent.setType(mimeType);
intent.putExtra(Intent.EXTRA_TEXT, [MY_STRING_URL]);
intent.putExtra(EXTRA_PROTOCOL_VERSION, PROTOCOL_VERSION);
intent.putExtra(EXTRA_APP_ID, YOUR_APP_ID);
activity.startActivityForResult(shareIntent, SHARE_TO_MESSENGER_REQUEST_CODE);
This crashes with:
E/AndroidRuntime( 2429): FATAL EXCEPTION: main
E/AndroidRuntime( 2429): java.lang.ClassCastException: com.facebook.messaging.sharing.f cannot be cast to com.facebook.messaging.sharing.bs
E/AndroidRuntime( 2429): at com.facebook.messaging.sharing.cz.a(ShareLauncherActivity.java:294)
E/AndroidRuntime( 2429): at com.facebook.messaging.sharing.cz.onSuccess(ShareLauncherActivity.java:286)
E/AndroidRuntime( 2429): at com.google.common.f.a.q.run(Futures.java:1231)
E/AndroidRuntime( 2429): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
E/AndroidRuntime( 2429): at com.facebook.common.executors.dv.run(WrappingExecutorService.java:77)
E/AndroidRuntime( 2429): at android.os.Handler.handleCallback(Handler.java:615)
E/AndroidRuntime( 2429): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 2429): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 2429): at android.app.ActivityThread.main(ActivityThread.java:4745)
E/AndroidRuntime( 2429): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2429): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 2429): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
E/AndroidRuntime( 2429): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime( 2429): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 312): Force finishing activity com.facebook.orca/com.facebook.messaging.sharing.ShareLauncherActivity
If I add:
intent.putExtra(Intent.EXTRA_STREAM, contentUri);
it doesn't crash but since my URL is just a link and does not point to a file, I get various errors: that the content could not be found, or, if I put a fake contentUri, the real URL I want to share is not activated upon clicking. If I remove:
intent.putExtra(EXTRA_APP_ID, YOUR_APP_ID);
it doesn't crash either but then users who have not installed my app (from which the sharing is done) do not get the Facebook Messenger "Install" button.
How can I share a web link and at the same time have users get the "Install" and "Reply" buttons as needed?

Android studio is not showing any errors but my logcat shows that there are errors

this is my logcat-
03-23 21:02:12.573 22442-22442/the.falacermusicE/AndroidRuntime:FATAL EXCEPTION: main
android.app.SuperNotCalledException: Activity {the.falacermusic/the.falacermusic.ui.activities.HomeActivity} did not call through to super.onStart()
at android.app.Activity.performStart(Activity.java:5196)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2087)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2139)
at android.app.ActivityThread.access$700(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1241)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4963)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
03-23 21:02:12.573 22442-22442/the.falacermusicE/AndroidRuntime:FATAL EXCEPTION: main android.app.SuperNotCalledException: Activity {the.falacermusic/the.falacermusic.ui.activities.HomeActivity} did not call through to super.onStart()
As the error states you are implementing the onStart method in your HomeActivity but you are not going throgh the super.onStart() method.