Skip to content

Commit 0a72c8f

Browse files
author
Suneet Srivastava
committed
fix: crash on connect to us on facebook in about section
1 parent a9ef6e4 commit 0a72c8f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

app/src/main/java/org/fossasia/phimpme/gallery/activities/AboutActivity.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.fossasia.phimpme.gallery.activities;
22

3+
import android.content.ActivityNotFoundException;
34
import android.content.Context;
45
import android.content.Intent;
56
import android.content.pm.PackageManager;
@@ -223,10 +224,14 @@ public void onClick(View view) {
223224
new View.OnClickListener() {
224225
@Override
225226
public void onClick(View view) {
226-
Intent facebookIntent = new Intent(Intent.ACTION_VIEW);
227-
String facebookUrl = getFacebookPageURL(getApplicationContext());
228-
facebookIntent.setData(Uri.parse(facebookUrl));
229-
startActivity(facebookIntent);
227+
try {
228+
Intent facebookIntent = new Intent(Intent.ACTION_VIEW);
229+
String facebookUrl = getFacebookPageURL(getApplicationContext());
230+
facebookIntent.setData(Uri.parse(facebookUrl));
231+
startActivity(facebookIntent);
232+
}catch (ActivityNotFoundException e){
233+
cts.launchUrl("https://www.facebook.com/phimpmeapp");
234+
}
230235
}
231236
});
232237

0 commit comments

Comments
 (0)