Skip to content

Instantly share code, notes, and snippets.

View sumanabhi's full-sized avatar
🧑‍💻
learning and contributing

Abhinav Sumaan sumanabhi

🧑‍💻
learning and contributing
View GitHub Profile
import android.app.LocaleManager
import android.content.Context
import android.os.Build
import android.os.LocaleList
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.os.LocaleListCompat
import java.util.Locale
/// Change Langauage Extenstion
@emedinaa
emedinaa / gist:4e3fa0baab7bbb20684b8476776ffc80
Created March 26, 2020 23:52
Socket IO + android + kotlin
socketio='1.0.0'//‘io.socket:socket.io-client:1.0.0' https://mvnrepository.com/artifact/io.socket/socket.io-client/1.0.0
implementation "io.socket:socket.io-client:$rootProject.socketio"
package com.emedinaa.kotlinapp.data.socket
import io.socket.client.Ack
import io.socket.emitter.Emitter
import androidx.annotation.Nullable
import io.socket.client.IO

Android Interview Questions

Q1: Explain activity lifecycle ☆☆

Answer: As a user navigates through, out of, and back to your app, the Activity instances in your app transition through different states in their lifecycle.

To navigate transitions between stages of the activity lifecycle, the Activity class provides a core set of six callbacks: onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy(). The system invokes each of these callbacks as an activity enters a new state.

@vganin
vganin / GridLayoutManager.java
Created October 17, 2015 18:57
Workaround for bug with RecycleView focus scrolling when navigating with d-pad (http://stackoverflow.com/questions/31596801/recyclerview-focus-scrolling)
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
/**
* {@link GridLayoutManager} extension which introduces workaround for focus finding bug when
* navigating with dpad.
*
* @see <a href="http://stackoverflow.com/questions/31596801/recyclerview-focus-scrolling">http://stackoverflow.com/questions/31596801/recyclerview-focus-scrolling</a>
@louisbl
louisbl / LocationFragment.java
Last active September 28, 2021 20:53
Fragment for Location Manager
package;
import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;