title: android custom url scheme..?
body: <p>Im trying to create my own url scheme so my android app can get called via an URL but for now I dont have a success.</p>
  
  <p>Im trying to have this url to work : cedemo://com.cedemo.scan?X=toto</p>
  
  <p>Here is part of my manifest file :</p>
  
  <pre><code>&lt;activity android:name=".Gallery1" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="portrait"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.GALLERY" /&gt;
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
              &lt;data android:scheme="cedemo" android:host="com.cedemo.scan" /&gt;
  
          &lt;/intent-filter&gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p>Does anyone can help telling me what is wrong ?
  Also, if someone find what is wrong, can someone tell me how I read the "X" variable from inside the android code from my app ?</p>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <p>Update: I did the modification of the action (as advised in one of the answers) and it's worked fine. The thing is that I still cannot get the url variable value. Here is the code I tried.</p>
  
  <pre><code>final Intent intent = getIntent();
  final String myScheme=intent.getScheme();
  final Bundle myBundle=intent.getExtras();
  final boolean inContestKey;
  if (myBundle != null) {
      inContestKey=myBundle.containsKey("inContest");
  }
  final Uri myURI=intent.getData();
  final String value;
  if (myURI != null) {
      value = myURI.getQueryParameter("inContest");
  }
  </code></pre>
  
  <p>But I receiving <code>null</code> from all the functions… what else can i do?</p>
  
  <p>May be I should explain better the context of my software:</p>
  
  <ol>
  <li>My software is started</li>
  <li>My software launch then the browser</li>
  <li>the user click a link in the browser and the browser go to the url scheme, back to the software with a variable  "X" (for example)</li>
  <li>the software should read the variable "X"</li>
  </ol>
  
  <p>But in my case : <code>myScheme</code>, <code>myBundle</code>, <code>myURI</code> are set to <code>null</code>.</p>
  
  <p>Any ideas ?</p>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <p>I found the answer is that you have to be in the main activity to do that.</p>