dimanche 24 mai 2015

How to handle custom url in android

I'm trying to handle a custom event generated by me and I'm encountering an error.

My intent is:

<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="eg" android:host="action" />

My activity is:

Intent intent = getIntent();
if (Intent.ACTION_VIEW.equals(intent.getAction())) {
    Uri uri = intent.getData();
    String valueOne = uri.getQueryParameter("lat");
    String valueTwo = uri.getQueryParameter("long");
} 

I am getting error in if condition. errors: cannot resolve the symbol 'equals' cannot resolve the symbol 'getAction' I have imported all the necessary header files.

Aucun commentaire:

Enregistrer un commentaire