Posts

Showing posts from October, 2020

FireStore RecyclerView With Text and Image View.

build.gradle ( app level) apply plugin : 'com.android.application' apply plugin : 'com.google.gms.google-services' android { compileSdkVersion 29 buildToolsVersion "29.0.3" defaultConfig { applicationId "hego.android.befoodie" minSdkVersion 23 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile( 'proguard-android-optimize.txt' ), 'proguard-rules.pro' } } } dependencies { implementation fileTree( dir : "libs" , include : [ "*.jar" ]) implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.1' implementation 'androidx.legacy:legacy-support-v4:1.0.0...

Survive Configuration change with ViewModel

Manifest.xml <? xml version ="1.0" encoding ="utf-8" ?> < manifest xmlns: android ="http://schemas.android.com/apk/res/android" package ="hego.android.savestatewithviewmodel" > < uses-permission android :name ="android.permission.INTERNET" /> < application android :allowBackup ="true" android :icon ="@mipmap/ic_launcher" android :label ="@string/app_name" android :roundIcon ="@mipmap/ic_launcher_round" android :supportsRtl ="true" android :theme ="@style/AppTheme" > < activity android :name =".MainActivity" > < intent-filter > < action android :name ="android.intent.action.MAIN" /> < category android :name ="android.intent.category.LAUNCHER" /> </ intent-filter > ...