Adds intent listener for nxtb.it links
This commit is contained in:
parent
01182a0eee
commit
56a420bb7a
2 changed files with 24 additions and 0 deletions
|
|
@ -30,6 +30,16 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value=".MainActivity" />
|
android:value=".MainActivity" />
|
||||||
|
<intent-filter android:label="">
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
|
||||||
|
<data android:scheme="http"
|
||||||
|
android:host="nxtb.it"
|
||||||
|
android:pathPrefix="/" />
|
||||||
|
<!-- note that the leading "/" is required for pathPrefix-->
|
||||||
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".ReturnActivity"
|
<activity android:name=".ReturnActivity"
|
||||||
android:label="@string/title_activity_return">
|
android:label="@string/title_activity_return">
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
package com.example.hochi.nextcompanion;
|
package com.example.hochi.nextcompanion;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.net.Uri;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import org.w3c.dom.Text;
|
||||||
|
|
||||||
public class RentActivity extends AppCompatActivity implements AsyncTaskCallbacks<String> {
|
public class RentActivity extends AppCompatActivity implements AsyncTaskCallbacks<String> {
|
||||||
private RequestHandler rentRequestTask = null;
|
private RequestHandler rentRequestTask = null;
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -21,6 +25,16 @@ public class RentActivity extends AppCompatActivity implements AsyncTaskCallback
|
||||||
rentRequest();
|
rentRequest();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Intent intent = getIntent();
|
||||||
|
// String action = intent.getAction();
|
||||||
|
Uri data = intent.getData();
|
||||||
|
|
||||||
|
if (data != null) {
|
||||||
|
String bikeID = data.toString().substring(15);
|
||||||
|
((TextView) findViewById(R.id.bike_id)).setText(bikeID);
|
||||||
|
rentRequest();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rentRequest() {
|
void rentRequest() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue