Posts

Showing posts from June, 2017

How to hide and show Action Bar?

Action Bar – Hide and Show To hide Action Bar, invoke hide() method using getSupportActionBar( ) [getActionBar( ) in case of minSDKVersion is 11 or higher] as shown below: 1 getSupportActionBar().hide(); 2 // If your minSdkVersion is 11 or higher, instead use: 3 //getActionBar().hide(); To show Action Bar, invoke show() method using getSupportActionBar( ) [getActionBar( ) in case of minSDKVersion is 11 or higher] as shown below: view source print ? 1 getSupportActionBar().show(); 2 // If your minSdkVersion is 11 or higher, instead use: 3 //getActionBar().show();

Introduction to Android Fragments

Image
Introduction to Android Fragment? How to create Android Fragment? What are the types of Fragments? Let us start with Introduction to Android Fragment. What is Android Fragment? As per Official Android Developer  Website : A Fragment represents a behavior or a portion of user interface in an Activity. You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities. You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running (sort of like a “sub activity” that you can reuse in different activities). Here is my quick pointers on Fragment: A Fragment is a piece of code which represents portion of User interface in an Activity or it can just be a Non UI stuff to handle asynchronous tasks at the background A fragment has its own layout and its own behavior with its own life cycle cal

How to Send Simple Data to Other Apps?

What is Intent? Intents are system messages, running around the inside of the device, notifying applications of various events, from hardware state changes (e.g.,an SD card was inserted), to incoming data (e.g., an SMS message arrived),to application events (e.g., your activity was launched from the device’s main menu). What are we going to develop? The application which we are going to develop will have couple of buttons. You can send text or images to other applications on clicking those button. Need of send and receive data Sending and receiving data (See  How to Receive Simple Data from Other Apps? ) between applications with intents is most commonly needed for social sharing of content. Intents allow users to share information quickly and easily, using their favorite applications. Intent – Construction Constructing a Intent involves five steps, they are: Step 1: Create and instantiate Intent object 1 Intent sendIntent = new Intent(); Step 2: Specify th