Commit bfaf16bc authored by Danang Afnan Hudaya's avatar Danang Afnan Hudaya
Browse files

task completed

parent 402caf0e
......@@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/ImplsitIntents.iml" filepath="$PROJECT_DIR$/ImplsitIntents.iml" />
<module fileurl="file://$PROJECT_DIR$/ImplicitIntentsReceiver.iml" filepath="$PROJECT_DIR$/ImplicitIntentsReceiver.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
......
......@@ -4,7 +4,7 @@ android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.asus.implsitintents"
applicationId "com.example.asus.implicitintentsreceiver"
minSdkVersion 22
targetSdkVersion 25
versionCode 1
......
package com.example.asus.implsitintents;
package com.example.asus.implicitintentsreceiver;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
......@@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.asus.implsitintents", appContext.getPackageName());
assertEquals("com.example.asus.implicitintentsreceiver", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.asus.implsitintents">
package="com.example.asus.implicitintentsreceiver">
<application
android:allowBackup="true"
......@@ -15,6 +15,13 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="developer.android.com" />
</intent-filter>
</activity>
</application>
......
package com.example.asus.implicitintentsreceiver;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent intent = getIntent();
Uri uri = intent.getData();
if (uri != null) {
String uri_string = "URI: " + uri.toString();
TextView textView = (TextView) findViewById(R.id.text_uri_message);
textView.setText(uri_string);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.asus.implicitintentsreceiver.MainActivity">
<TextView
android:id="@+id/text_uri_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textStyle="bold"/>
</android.support.constraint.ConstraintLayout>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment