Skip to content

Instantly share code, notes, and snippets.

View gsrathoreniks's full-sized avatar
🖥️
Building solutions

Gajendra Singh Rathore gsrathoreniks

🖥️
Building solutions
View GitHub Profile
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_login);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
BitMap bitmap = .......
------------------------------
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.putExtra(Intent.EXTRA_STREAM, getImageUri(getApplicationContext(),bitmap));
sharingIntent.setType("image/jpeg");
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "HEADING");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "SOME TEXT TO SHARE WITH IMAGE");
startActivity(Intent.createChooser(sharingIntent, "Share via"));
@gsrathoreniks
gsrathoreniks / Quit_app
Created July 13, 2018 09:10
To quit an Android app completely
if(Build.VERSION.SDK_INT>=16 && Build.VERSION.SDK_INT<21){
finishAffinity();
} else if(Build.VERSION.SDK_INT>=21){
finishAndRemoveTask();
}
open class BitmapUtils {
var _view: View? = null
var _context: Context? = null
constructor(context: Context, view: View) {
this._view = view
this._context = context
}
fun convertLayout(): Bitmap {
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.GradientDrawable;
import android.net.Uri;
import android.os.Build;
import android.support.design.widget.Snackbar;
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="355dp"
android:height="320dp"
android:viewportWidth="355"
android:viewportHeight="320">
<group
android:name="Page-1">
<path