|
9 | 9 | import android.support.v7.widget.DividerItemDecoration;
|
10 | 10 | import android.support.v7.widget.LinearLayoutManager;
|
11 | 11 | import android.support.v7.widget.RecyclerView;
|
12 |
| -import android.widget.Toast; |
13 | 12 |
|
14 | 13 | import com.pedrogomez.renderers.RVRendererAdapter;
|
15 | 14 |
|
|
20 | 19 | import butterknife.BindView;
|
21 | 20 | import butterknife.ButterKnife;
|
22 | 21 | import fr.free.nrw.commons.R;
|
| 22 | +import fr.free.nrw.commons.Utils; |
23 | 23 | import fr.free.nrw.commons.theme.NavigationBaseActivity;
|
24 | 24 | import io.reactivex.Observable;
|
25 | 25 | import io.reactivex.android.schedulers.AndroidSchedulers;
|
26 | 26 | import io.reactivex.schedulers.Schedulers;
|
27 | 27 | import timber.log.Timber;
|
28 | 28 |
|
29 |
| -import static android.widget.Toast.LENGTH_SHORT; |
30 |
| - |
31 | 29 | /**
|
32 | 30 | * Created by root on 18.12.2017.
|
33 | 31 | */
|
@@ -82,14 +80,7 @@ private void handleUrl(String url) {
|
82 | 80 | if (url == null || url.equals("")) {
|
83 | 81 | return;
|
84 | 82 | }
|
85 |
| - Intent browser = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); |
86 |
| - //check if web browser available |
87 |
| - if(browser.resolveActivity(this.getPackageManager()) != null){ |
88 |
| - startActivity(browser); |
89 |
| - } else { |
90 |
| - Toast toast = Toast.makeText(this, getString(R.string.no_web_browser), LENGTH_SHORT); |
91 |
| - toast.show(); |
92 |
| - } |
| 83 | + Utils.handleWebUrl(this, Uri.parse(url)); |
93 | 84 | }
|
94 | 85 |
|
95 | 86 | private void setAdapter(List<Notification> notificationList) {
|
|
0 commit comments