android - Cannot open my app from url -


When I click on a link in the browser browser, then I'm trying to open my app. I tried to use the scheme to open my app. The change made in the manifest is given below.

  & amp; Activity Activity: Name = "com.test.testapp.TestAppActivity" android: label = "@ string / App_name" android: export = "true" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; Intent-Filter & gt; & Lt; Data Android: scheme = "testcheme" /> & Lt; Action Android: name = "android.intent.action.VIEW" /> & Lt; Category android: name = "android.intent.category.BROWSABLE" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt;  

I also have internet permissions. However opening links like "testcheme: // testID = 1" "Do not open my app, is there any mistake I'm getting from? I can not find a solution anywhere for this. help please.

I tried to reproduce your problem and I could not. Here's what I have:
A Activity with a very simple layout (only one TextView )

  package com.test .testapp; Import android App Import android.content.Intent; Import android.net.Uri; Importroid.os.Bundle; Import android.widget.TextView; Import com.example.adip.R; Expansion of Public Class TestAppActivity Activity {@Override Creates Secure Zero (Bundle Saved Instantstate) {super.onCreate (savedInstanceState); SetContentView (R.layout.web_layout); TextView txtLabel = (TextView) Find ViewById (R.id.txtLabel); Intro startIntent = getIntent (); Uri Data = startIntent.getData (); If (data == zero) {txtLabel.setText ("no data provided!"); } And {txtLabel.setText (data .toString ()); }}}  

B What do you have in the manifest:

  & lt; Activity Android: name = "com.test .testapp.TestAppActivity" android: export = "true" android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; Intent-Filter & gt; & Lt; Data Android: scheme = "testcheme" /> & Lt; Action Android: name = "android.intent.action.VIEW" /> & Lt; Category android: name = "android.intent.category.BROWSABLE" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt;  

C A sample.html file that I published on the local Tomcat web server.

  & lt; Html & gt; & Lt; Body & gt; & Lt; A href = "testcheme: // testID = 1" & gt; Test scheme & lt; / A & gt; & Lt; Br / & gt; & Lt; A href = "http://www.stackoverflow.com" & gt; The working link is SO & lt; / A & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

When this file opens both links from a browser , then it works:

  1. The first link TestAppActivity < TextView : testcheme: // testID = 1 - what exactly do I have in the html
  2. The second link is good - the old stack in the same browser Overflow

You have to do something wrong and it is small that you can not see it :). Maybe you have typed the link in the HTML file incorrectly ...

Nevertheless, compare between what I have provided and whatever it is.


Comments