This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected OnBackPressedListener onBackPressedListener; | |
//... | |
public void setOnBackPressedListener(OnBackPressedListener onBackPressedListener) { | |
this.onBackPressedListener = onBackPressedListener; | |
} | |
//... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Deep Link Activity : Start --> | |
<activity | |
android:name=".deeplinks.LinkDispatcherActivity" | |
android:alwaysRetainTaskState="true" | |
android:launchMode="singleTask" | |
android:noHistory="true" | |
android:theme="@android:style/Theme.Translucent.NoTitleBar"> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW"/> | |
<category android:name="android.intent.category.DEFAULT"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The `fragment` is added to the container view with id `frameId`. | |
* The operation is performed by the `fragmentManager`. | |
*/ | |
fun AppCompatActivity.addFragment( | |
fragmentManager: FragmentManager, | |
fragment: Fragment, | |
frameId: Int) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AccountDetailsActivity : Activity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val accountNumber = intent.getStringExtra(ACCOUNT_NUMBER) | |
?: throw IllegalStateException("ACCOUNT_NUMBER is mandatory in the Intent") | |
} | |
companion object { | |
private val ACCOUNT_NUMBER = "ACCOUNT_NUMBER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Declaring Response class as sealed class means, | |
* It is an Abstract class like in Java. We can have all the features | |
* in Sealed class which Abstract class has. | |
* In this example, added one property field to sealed class "Tag" and | |
* This is overridden in the classes extended to this sealed class. | |
* Sealed classes are used to have restricted hierarchy. | |
*/ | |
sealed class Response { | |
open var tag: String = "" |