Category:

Clear back stack in android

In some of application we need to implement logout functionality this is one of very easy way to clear all history in your application of activity. Intent i= new Intent(MainActivity.this, Login.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(i); finish(); 🙂  

Continue Reading
Posted On :
Category:

Read raw data in PHP

This is very useful tip for those who want to read a raw input data in PHP, In simple word when user send JSON data to server you did not have any key to access that data so you use this kind of techniques to do that <?php $postdata = file_get_contents(“php://input”); $data = json_decode($postdata); echo […]

Continue Reading
Posted On :
Category:

Animation between login and forgot screen android

Last updated on March 13th, 2020 at 12:02 pmIn this tip i am going to share a simple and use full code which help you to save extra screen and also a simple animation between layout in android Layout Code <FrameLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” android:background=”@color/colorPrimaryDark” android:orientation=”vertical” android:paddingBottom=”@dimen/activity_vertical_margin” android:paddingLeft=”@dimen/activity_horizontal_margin” android:paddingRight=”@dimen/activity_horizontal_margin” android:paddingTop=”@dimen/activity_vertical_margin”> <LinearLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:orientation=”vertical”> […]

Continue Reading
Posted On :
Category:

Create round image by code android

In this i tip i am going to sharing some useful code to create round  or circle image in android and set on imageview or image button. Convert Image to Bitmap and Crop image if you want to set image in specific view public Bitmap localImageToBitmap(int source, int THUMBNAIL_SIZE) { int size = THUMBNAIL_SIZE; Bitmap […]

Continue Reading
Posted On :
Category:

Fix toolbar spacing android

In this tip i show you how you can remove spacing from custom toolbar android To remove left and right side space from toolbar try this <android.support.v7.widget.Toolbar xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:id=”@+id/menuToolbar” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_margin=”0dp” android:background=”@color/white” android:contentInsetLeft=”10dp” android:contentInsetRight=”10dp” android:contentInsetStart=”10dp” android:minHeight=”?attr/actionBarSize” android:padding=”0dp” app:contentInsetLeft=”10dp” app:contentInsetRight=”10dp” app:contentInsetStart=”10dp”> /* — Your Stuff —*/ </android.support.v7.widget.Toolbar> Use contentInsetStart to set spacing in your custom […]

Continue Reading
Posted On :