Skip to content

Instantly share code, notes, and snippets.

View pokk's full-sized avatar
🌀

Jieyi pokk

🌀
View GitHub Profile
@pokk
pokk / Context using scenarios.md
Last active February 21, 2017 04:13
Context using scenarios in the common.

[TOC]

Introduction

How to use Context correctly in android.

How many contexts in an application

As following we understood, subclasses of Context are Activity, Service, Application, ...etc.

@pokk
pokk / README.md
Last active July 3, 2017 06:12
the using occasions of lateinit and lazy

[TOC]

Introduction

Introduce that we should use the way of occasions of lateinit and lazy simplely.

lateinit

  1. Import external variable or method, that object is built from external constructor. The lifecycle of self doesn't relate with external object.
@pokk
pokk / README.md
Last active November 9, 2020 11:14
Kotlin stdlib "let", "run", "apply", "also", "use", "with"

[TOC]

Introduction

There are very good five stdlib operates we can use.

  1. let
  2. run
  3. apply
  4. also
@pokk
pokk / README.md
Created December 7, 2016 08:31
Activity and Fragment lifecycle.

Introduction

Activity

Activity life cycle normally

onCreate ->
onStart ->
@pokk
pokk / README.md
Last active December 16, 2016 07:44
Add the user agent in your WKWebView.

Introduction

Add the user agent in your WKWebView.

@pokk
pokk / README.md
Last active December 16, 2016 07:28
change URL request or set an action in WebViewClient

Introduction

Changing the default action before loading a url link.

@pokk
pokk / README.md
Created November 18, 2016 00:56
Obtain http header information.

Introduction

We can obtain all of the HTTP header information from WKWebView.

@pokk
pokk / README.md
Last active November 15, 2016 08:18
Implement a web application in Android.

Introduction

When develope the web app in Android, you have to customize all of the function by yourself; otherwise, they don't work.

  1. WebViewClient
  2. WebChromeClient
  3. DownloadListener

We should implement three classes for handling various actions you need.

@pokk
pokk / README.md
Last active April 5, 2017 02:39
Implement the broadcast & receiver and local of both.

[TOC]

Introduction

  1. Broadcast & Receiver
  2. LocalBroadcast & LocalReceiver

Broadcast & Receiver

@pokk
pokk / MyActivity.java
Last active January 11, 2017 06:23
Create a intent to open other intent
public class MyActivity extends Activity {
public static final int INPUT_FILE_REQUEST_CODE = 5568;
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (RESULT_OK == resultCode) {
switch (requestCode) {
case INPUT_FILE_REQUEST_CODE: