Skip to content

Commit 1626a4e

Browse files
committed
Fixed results text display
1 parent 85738e0 commit 1626a4e

File tree

4 files changed

+35
-5
lines changed

4 files changed

+35
-5
lines changed

sample/src/main/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323
android:exported="false"/>
2424
<activity
2525
android:name=".ResultActivity"
26-
android:exported="false"/>
26+
android:exported="true"/>
2727
<activity
2828
android:name=".MainActivity"
2929
android:exported="true">
3030
<intent-filter>
3131
<action android:name="android.intent.action.MAIN"/>
32-
3332
<category android:name="android.intent.category.LAUNCHER"/>
3433
</intent-filter>
3534
</activity> <!-- optional service to allow launching the sample app from the quick settings -->

sample/src/main/kotlin/io/github/g00fy2/quickiesample/ResultActivity.kt

+21-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ package io.github.g00fy2.quickiesample
22
import android.annotation.SuppressLint
33
import android.content.Intent
44
import android.os.Bundle
5+
import android.os.Handler
6+
import android.os.Looper
7+
import android.view.View
58
import android.webkit.JavascriptInterface
69
import android.webkit.WebView
710
import android.widget.TextView
@@ -11,16 +14,32 @@ import androidx.core.content.ContextCompat.startActivity
1114
import androidx.core.view.ViewCompat
1215
import androidx.core.view.WindowCompat
1316
import androidx.core.view.WindowInsetsCompat
17+
import io.github.g00fy2.quickiesample.databinding.ActivityMainBinding
18+
import io.github.g00fy2.quickiesample.databinding.ActivityResultBinding
1419

1520
public class ResultActivity : AppCompatActivity() {
21+
private lateinit var binding: ActivityResultBinding
1622

1723
override fun onCreate(savedInstanceState: Bundle?) {
1824
super.onCreate(savedInstanceState)
1925

2026
val bundle = intent.extras
21-
val postMsg = bundle?.getString("postMsg")
27+
val postMsg = bundle!!.getString("postMsg")
2228

23-
val myTextView: TextView = findViewById(R.id.textView)
29+
binding = ActivityResultBinding.inflate(layoutInflater)
30+
setContentView(binding.root)
31+
32+
val myTextView: TextView = findViewById(R.id.textViewResult)
2433
myTextView.text = postMsg
34+
35+
binding.continueToMain.setOnClickListener {
36+
continueToMainClick
37+
}
38+
39+
}
40+
41+
val continueToMainClick = View.OnClickListener {
42+
val resultActivityIntent = Intent(this, MainActivity::class.java)
43+
startActivity(resultActivityIntent)
2544
}
2645
}

sample/src/main/res/layout/activity_result.xml

+12-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,20 @@
99
>
1010

1111
<TextView
12-
android:id="@+id/textView"
12+
android:id="@+id/textViewResult"
1313
android:layout_width="match_parent"
1414
android:layout_height="136dp"
1515
android:gravity="center"
1616
/>
17+
18+
<Button
19+
android:id="@+id/continueToMain"
20+
android:layout_width="match_parent"
21+
android:layout_height="wrap_content"
22+
android:layout_marginBottom="16dp"
23+
android:layout_marginEnd="64dp"
24+
android:layout_marginStart="64dp"
25+
android:text="@string/continueButtonText"
26+
/>
27+
1728
</LinearLayout>

sample/src/main/res/values/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
<string name="title_activity_fullscreen">FullscreenActivity</string>
1111
<string name="dummy_button">Dummy Button</string>
1212
<string name="dummy_content">DUMMY\nCONTENT</string>
13+
<string name="continueButtonText">Continue</string>
1314
</resources>

0 commit comments

Comments
 (0)