Author name: Laura Prata

Snippets, Solutions

Android: Prevent cut-copy-paste popup to be displayed

If you ever need to disable the popup for cut-copy-paste when you long tap a text from an edit text you can do this by using the code below: yourEditText.setCustomSelectionActionModeCallback(new Callback() { public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } public void onDestroyActionMode(ActionMode mode) { } public boolean onCreateActionMode(ActionMode mode, Menu menu) { […]

, , , , ,
Snippets, Solutions

Android Get Application Context

When we are inside an Activity, and we need the application context we can use getApplicationContext()  method. But what if we are not inside an Activity and we need the application context? Well, I will explain in this tutorial how you can get the context of the application outside an Activity. You have to create

, , , ,
Snippets, Solutions

ExpandableListView, how to hide indicator

If you use an ExpandableListView and want to hide the group indicator (that arrow that appears on the left) you need to put this in your xml file where the ExpandableListView is created: android:groupIndicator=”@null” Below is a complete example of an xml file: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”fill_parent” android:layout_height=”fill_parent” > <ExpandableListView android:id=”@+id/expandable_list” android:layout_width=”fill_parent”

,
Privacy Policy

Privacy Policy

Privacy Policy for myandroidsolutions The privacy of our visitors to myandroidsolutions is important to us. At myandroidsolutions, we recognize that privacy of your personal information is important. Here is information on what types of personal information we receive and collect when you use and visit myandroidsolutions, and how we safeguard your information. We never sell

Snippets, Solutions, Tutorial

Android Add Views into a ViewGroup Dynamically

As Android developer you will surely  need someday to add views dynamically, instead of creating a ListView. I will show you in this tutorial how to do this :) 1. Create a new project and call your activity “MyActivity” 2. Go to res – layout – main.xml and put the following code: <?xml version=”1.0″ encoding=”utf-8″?> <ScrollView

, , , , , , ,
Snippets, Solutions

SQLite Query For Dates Equals To Today

Let’s start with an example: We have a table called StartDate with some dates stored into it as long (milliseconds) like in the image below: To understand better which date represents each record I will write below their dates: 1. Tuesday, February 5, 2013 8:10:17 PM GMT 2. Friday, February 1, 2013 8:10:17 PM GMT 3. Wednesday, February

, , , , ,
sponsored
Exit mobile version