Android :: Create Multiple Context Menus?
Sep 4, 2010
I have 1 activity, but would like to have multiple context menu's for different UI components.
For example, I have a ListView which will react to:
CODE:...................
How can I create another context menu for the onClick event for an ImageView I have?
View 2 Replies
Jun 11, 2010
I want to view two listviews at the same time. This is not the problem!
What I don't know if it's possible is if I can have two different context menus for the two lists? And second, is there a way to check in which of the two lists the user has selected an item?
View 3 Replies
View Related
Feb 9, 2009
How could I capture an onListItemClick() and pass it to onCreateContextMenu()? In my ListActivity, I don't need regular clicks, so I'd like everything to go to the context menu.
View 3 Replies
View Related
Oct 3, 2010
My app used to use a standard ListView, and registerForContextMenu(getListView()) and everything worked just fine.
I needed to change my app to accommodate nested lists so I replaced the ListView with ExpandableListView. I changed the Activity to ExpandableListActivity. I also changed my adapter to a tree adapter and implemented a custom view class to populate the list with (based on a FrameLayout view).
Suddenly my context menus stopped working and I can't figure out why. I can't long click on any of my list items and I'm completely stuck on where to start looking.
View 1 Replies
View Related
Feb 1, 2013
Can I somehow change color of texts in context menus? It has white color and the background is white too, so I can't see the text.
I'm using this ROM on my Xperia X10 Mini Pro.
I'm attaching some screenshots for better explaining of my problem.
View 4 Replies
View Related
May 15, 2009
When you are developing on an application level(Services, Activities) you always get this Context reference automatically. But what if I am on a lower level and developing a program started with app_process, how can I get hold of a Context then? Its a huge part of the API that need this context. What the proper way to create a Context instance?
View 7 Replies
View Related
Apr 7, 2010
I am using XML file for creating Context Menu for my ListView. (Please see below). I also want to set a header for this Context Menu. I read (at http://www.mail-archive.com/android-developers@googlegroups.com/msg43062.html)that I can use menu.setHeaderTitle(myContextMenuTitle) in onCreateContextMenu Method. But I need to set this in XML file. How can I accomplish this?
Following is code for onCreateContextMenu Method, correct me if I am doing anything wrong. This is my context_menu.xml file:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/open" android:title="Open"/>
</menu> Code...
View 1 Replies
View Related
Oct 15, 2010
I'm getting all kinds of errors when using res/menu/menu_home.xml, and my project won't build. That's when I remembered that there was a way to create menus from java code instead of declaring it via xml. Does someone remember how to do that?
View 1 Replies
View Related
Jun 17, 2010
Is it possible to create a dynamic context menu in android? What I mean is, for example, if I have a list of items, that can be in two states: "read" and "unread". I want to be able to bring up a context menu with an option of "Mark as Read" for the unread items, and "Mark as Unread" for the read items.....
View 1 Replies
View Related
Aug 20, 2009
This maybe against the way the Android team wants this to work, but if not I can't seem to come up with a way to do this. Basically I have a list view that I want to create a ContextMenu when onListItemClick received. So when the user clicks on a list item I want them to choose the action from a ContextMenu. Anyone have an example of how to do this, I can get it to work with no problems with a long press, but my users are missing the menu and just thinking the ListView does nothing.
View 5 Replies
View Related
Sep 1, 2010
is it possible to start a context menu on the onCreate method? I know its probably bad design ethics but I have my resons! I've tried the: register For Context Menu (this.getCurrentFocus()); But its not working.. So does anyone have any better ideas?
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout layout = new LinearLayout(this);
layout.setLayoutParams(new
LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
//Button button = new Button(this);
//button.setLayoutParams(new
//LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
//button.setText("my button");
TextView text = new TextView(this);
text.setLayoutParams(new
LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
layout.addView(text);
setContentView(layout);
registerForContextMenu(text);
openContextMenu(layout);
View 1 Replies
View Related
Jun 7, 2010
I have to use context in many places of my code such as database operations, preference operations, etc. I don't want to pass in context for every method. Is it a good practice to create a reference to application context at the main Activity and use it anywhere such as database operations? So, I don't need some many context in method parameters, and the code can avoid position memory leak due to use of Activity Context.
View 1 Replies
View Related
May 6, 2009
In my application, i want to create multiple tabs. For example, i have a button on clicking which should create one more tab,(just like Mozilla browser). I searched on Internet as well as Android Documentation. but did not get any clue...
View 3 Replies
View Related
Nov 7, 2010
How to create multiple View in one screen?
View 2 Replies
View Related
Feb 19, 2010
I want to create multiple instances of an activity in the same process. Should I use FLAG_ACTIVITY_NEW_TASK flag like the code below?
CODE:...............
This code is executed in class A to create another instance of activity A.
This question, will this code create another task? As I understand is a process can only have one task. Does it mean the two activities will exist in different tasks? That's what I want. I want the two activities to be in the same process.
View 1 Replies
View Related
Jun 4, 2010
I created multiple ExecutorService instances in my code, usually each UI page has one ExecutorService instance. Each ExecutorService instance will execute some http get request threads.
CODE:......
Is it OK to do that?
The problem I met is that sometimes the http get requests got response code -1 from HttpURLConnection getResponseCode() call. I don't know whether it is caused by multiple threadpool instances.
View 2 Replies
View Related
Jul 12, 2010
I know I cannot create two MapViews in a MapActivity. And I cannot create two MapActivities in a process. Is there a work around that will enable me to display two mapviews side by side?
View 6 Replies
View Related
Mar 23, 2009
I want to have multiple listviews in my activity. Every listview will have a different adapter and every item in the listview must be clickable (other actions for every listview).
So my problem now is that I can't create multiple clickable listviews. I have one listview like this <ListView android:id="@android:id/ list".. and the other listview looks like this <ListView android:id="@+id/ flightList"
The first listview looks like this in my activity hotelList = (ListView)findViewById(android.R.id.list);
the second: listView = (ListView) findViewById(R.id.flightList);
I can click on the first list and it does what it has to do, but i cant do anything with the second list.. probably because it hasn't the android:id/list declaration. does someone knows how I can solve this problem or other suggestions how I can get multiple lists in 1 activity.
View 25 Replies
View Related
Jul 1, 2010
I was wondering is it possible to create multiple instances of a single Activity in Android?
I currently start my own inCall screen for a Voip Test by using the following code...
This allows me to start the Activity fine. However when I call it for a second it just returns to the Activity already created rather than creating a new Activity and placing it on the stack.
I would like to be able to create the activity multiple times so that I have two or 3 Activities on the stack and the user can switch between them, using Home, Back buttons etc... Is this possible and if so what am I doing wrong?
View 1 Replies
View Related
Oct 12, 2010
i want to create a bitmap / image which has many images like "Collage" which has more then one images in a single picture. I have stored all my images in a grid view but now i want to create a single image from all those images. And even i want to make few images click able so what can be the road map to do this ? any sort of help / example will be helpful. search for a for collage image image in google . one can see what it is exactly.
View 2 Replies
View Related
Oct 19, 2010
I'm trying to create a title bar that is the same throughout my application and have been creating layouts like this for each of my activities:
main.xml:
<?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">
<include layout="@layout/title_bar_layout" android:id="@+id/title_bar_layout" />
<include layout="@layout/main_body" android:id="@+id/main_body" />
</LinearLayout>
main_body.xml:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_table" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:stretchColumns="1"
android:orientation="vertical">
</TableLayout> Code...
View 1 Replies
View Related
Feb 20, 2013
I want to make an application which allow user to add multiple recipient. Token for all recipient should be created and if i select any token and press back key,it should be deleted.
View 1 Replies
View Related
Jun 21, 2010
Is it possible to create and activate an apn programatically on android? Is it also possible to activate more than 1 apn at the same time?
View 1 Replies
View Related
Jun 30, 2010
The following code executes a function that retrieves a file via ftp and then displays it in an imageview. Since I'm using the main thread the UI locks up, somebody tells me I can use asynctask to make this work but I can't figure it out :<
Is anybody familiar with this that could offer me some guidance? code...
View 1 Replies
View Related
May 7, 2010
Any insights/pointers regarding creating a layout like this. I have wasted quite a bit of time on this. I want to create a vertical linearlayout which has multiple ExpandableListViews separated by TextViews.
CODE:.........................
I tried the following approaches but each of them has one shortcoming or the other:
1. Add TextView and ExpandableListViews to a linearlayout. The problem with this approach is that LinearLayout by default is unscrollable.
Adding the LinearLayout to a ScrollableView creates even more issues because ListViews handle their own scrolling behavior.
2. I tried using a single ExpandableListView to model the above layout but the problem is that setGroupIndicator applies to the entire ExpandableListView, not a specific group.
View 2 Replies
View Related
Feb 11, 2010
I was womdering how do i create different folders for things such as ringtones, notification tones.. etc.
View 3 Replies
View Related
Nov 22, 2011
i am creating an app for which i need to display multiple charts in single view.I am using achartengine library to create charts but i don't know how to merge and display 4 charts in single view.
View 1 Replies
View Related
Jul 19, 2012
I have about 150 apps installed, but only 30 of them are currently on the homescreen.
Is there a way to add the remaining 120 at once to the homescreens?
If I would have to do it manually (Samsung Galaxy Tab 10.1) it would take at least an hour to do (adding one shortcut is extremely slow, as my tab needs about 10 seconds to display the list of apps alone when creating a shortcut).I don't have to do it manually for each app.
View 3 Replies
View Related
May 26, 2013
I'm looking to clean up my home screens a little and would like to be able to create one on-screen folder or widget that can hold multiple other widgets for quick access and easy launch. Specifically, I have quite a few ColorNote files that I need quick access too, but don't necessarily want clogging up my home screen. I'm hoping there's something out there - either a folder organizer, launcher, or widget that can do this for me.
I currently use GoLauncher and FolderOrganizer on my SG Note.
View 2 Replies
View Related
Oct 10, 2012
im wondering is there such way to create a zip file with multiple zips in to flash at once? Purpose of it is to save time flashing 5 different zips through recovery every time we flash new roms?
View 2 Replies
View Related