Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | 🎉 :tada: |
| Version tag | 🔖 :bookmark: |
| New feature | ✨ :sparkles: |
| Bugfix | 🐛 :bug: |
| private var networkCallback: ConnectivityManager.NetworkCallback? = null | |
| private var connectivityManager: ConnectivityManager? = null | |
| //TODO use this method to register internet callback | |
| private fun startNetworkCallback() { | |
| connectivityManager = requireContext().getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | |
| val builder: NetworkRequest.Builder = NetworkRequest.Builder() | |
| NetworkConnectionVariables.context = context | |
| networkCallback = object : ConnectivityManager.NetworkCallback() { | |
| override fun onAvailable(network: Network) { |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | 🎉 :tada: |
| Version tag | 🔖 :bookmark: |
| New feature | ✨ :sparkles: |
| Bugfix | 🐛 :bug: |
| fun launchActivity(context: Activity, name: Class<*>, isClearTop: Boolean, isFinish: Boolean) { | |
| val intent = Intent(context, name) | |
| if (isClearTop) | |
| intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK | |
| context.startActivity(intent) | |
| if (isFinish) context.finish() | |
| } |
| //Response String is json String got as response from server | |
| JsonParser jsonParser = new JsonParser(); | |
| JsonElement jsonElement=jsonParser.parse(responseString.toString()); | |
| Gson gson= new Gson(); | |
| MyClassName classobject=gson.fromJson(jsonElement,MyClassName.class); |
| public class MainActivity extends AppCompatActivity { | |
| private final int PERMISSION_REQUEST_CODE = 1; | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| // list of permissions |