How to programmatically hide Imageview

I have a linearlayout with three icons as below

I have a linearlayout with three icons as below

 <ImageView
            android:id="@+id/cities"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content          
            android:src="@drawable/city" />
    &lt;ImageView
        android:id="@+id/red"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"           
        android:src="@drawable/red"
        android:visibility="gone" 
        /&gt;
    &lt;ImageView
        android:id="@+id/deal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"       
        android:src="@drawable/deal" /&gt;

initially the middle icon is hidden (android:visibility="gone") I have a login screen..when the login i success I want the icon to be visible ..tried as below..but itz not working

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.fyelogin);                    
etPassword = (EditText)findViewById(R.id.password);
btnLogin = (Button)findViewById(R.id.login_button);
btnCancel = (Button)findViewById(R.id.cancel_button);
lblResult = (TextView)findViewById(R.id.result);

final ImageView details = (ImageView)findViewById(R.id.red); 

btnLogin.setOnClickListener(new OnClickListener() {
    public void onClick(View v) {

        String password = etPassword.getText().toString();

        if(password.equals("guest")){
            lblResult.setText("password successful.");

giving error @ this line  -----&gt;  details.setVisibility(View.VISIBLE);

        } else {
            lblResult.setText("password doesn't match.");
        }

        finish();
    }
});


Kotlin Coroutines on Android - How to use Coroutines on Android

Kotlin Coroutines on Android - How to use Coroutines on Android

Coroutines are a Kotlin feature that convert async callbacks for long-running tasks, such as database or network access, into sequential code. This Kotlin Coroutines tutorial will show you how to use coroutines on Android, and how the new androidx-concurrent library makes it easy to use them to get things off the main thread. You'll also learn how the new library helps coroutines work with Architecture Components. This session also covers coroutine patterns, best practices, and even how to test coroutines!

Kotlin Coroutines on Android - How to use Coroutines on Android.

Coroutines are a feature of Kotlin that help convert callback-based code into sequential code, making code easier to read, write, and understand. This session will show you how to use coroutines on Android, and how the new androidx-concurrent library makes it easy to use them to get things off the main thread. You'll also learn how the new library helps coroutines work with Architecture Components. This session also covers coroutine patterns, best practices, and even how to test coroutines!

My Android app not supporting Android version 9

I have made an android app which uses webView. Everything was fine until I tried my app on Android P. On Android "P" the app is directly showing the error page that the app can't use Internet connection even though it is ON.

I have made an android app which uses webView. Everything was fine until I tried my app on Android P. On Android "P" the app is directly showing the error page that the app can't use Internet connection even though it is ON.

Android Manifest File:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.xxx.xxxxx.xxxxx">
&lt;!-- android:roundIcon="@mipmap/ic_launcher_round" --&gt;

&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
&lt;uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/&gt;
&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
&lt;uses-permission android:name="android.permission.CAMERA" /&gt;

&lt;application
    android:allowBackup="true"
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:hardwareAccelerated="true"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"&gt;
    &lt;activity android:name="com.xxxxx.xxxxx.xxxxxx.MainActivity"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.MAIN" /&gt;

            &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
        &lt;/intent-filter&gt;
    &lt;/activity&gt;
&lt;/application&gt;

</manifest>

Gradle File:

    apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.xxx.xxx.xxx"
minSdkVersion 19
targetSdkVersion 28
versionCode 3
versionName "3.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:28.0.0'
}

On Getting error in Android P, directly this section is being accessed:

public void onReceivedError(WebView view, int errorCode,
String description, String failingUrl) {
// You can redirect to your own page instead getting the default error page

            super.onReceivedError(view, errorCode, description, failingUrl);
            String path = Uri.parse("file:///android_asset/error.html").toString();
            webView.loadUrl("about:blank");
            view.loadUrl(path);
        }


Learn Android Programming from Scratch - Android Full Course

Learn Android Programming from Scratch - Android Full Course

This Android Full Course will help you learn Android programming language and its core concepts with examples from scratch. This Android Tutorial is ideal for both beginners as well as professionals who want to master mobile application development. Evolution of Android. Introduction to Android. Android Architecture. Android Features,...

This Android Full Course will help you learn Android programming language and its core concepts with examples from scratch. This Android Tutorial is ideal for both beginners as well as professionals who want to master mobile application development. Below are the topics covered in this Android Tutorial for Beginners:
2:41 Evolution of Android
3:53 Introduction to Android
4:50 Android Architecture
7:23 Android Features
9:57 Android Runtime
11:16 Android Studio Installation
36:52 Activity Life Cycle
45:07 Android Layouts
49:25 Linear Layout
52:42 Relative Layout
54:31 List View
55:41 Grid View
57:04 Recycler View
1:11:52 Install Java
1:14:42 Install Android Studio
1:17:22 Simple Program
1:24:12 What Is Android Studio?
1:26:02 Android Stack
2:12:12 Installation
2:51:29 What Is An Activity?
2:54:49 Activity Life Cycle
3:16:37 Event Listeners
3:33:30 Intents
3:45:39 Demo
4:28:04 What is Android SDK?
4:30:56 How To Install Android SDK?
4:34:38 Android SDK Features
4:36:43 SDK Tools
4:40:11 Android SDK Manager
4:40:45 Android Layout Design Tutorial
4:41:39 Introduction to UI Components
4:42:41 Views
4:43:46 Types of Layouts
4:50:34 Units of Measurement
4:51:57 Demo
5:05:00 Android Market and Salary Trends
5:08:38 Android Interview Questions
7:52:26 How to become an Android Developer?
7:53:29 Who is an Android Developer?
7:55:50 Roles and Responsibilities
7:57:12 Why become an Android Developer?
8:01:05 Job Roles for an Android Developer
8:04:14 Job Trends
8:07:04 How to start?
8:07:54 Kotlin
8:29:05 Android vs iOS
8:29:55 Market Share
8:32:59 Parameters
8:33:15 Comparison
8:35:26 Which is superior?