I create an Intent in one class then it's returned to another class. I need to check the type of intent it is. I need to ensure it's not a specific class of intent.
How to do this?
if( newIntent == ActivityName.class )
Edit:
So I would need to know if the new intent would equal an intent of a certain type:
newIntent = new Intent(c...
Hi
I need to enable a MenuItem when a previous screen (Activity) returns.
I tried this code:
...
((MenuItem)findViewById(R.id.menu_how)).setEnabled(true);
...
but a null pointer exception is launched.
BTW, the menu_how is set to false in xml; and the code is part of onActivityResult(int requestCode, int resultCode, Intent data) cal...
Alright so I'm just learning how to work with contacts and such. I would like to have my contacts listed out in a ListView, with custom adapter (I think thats what it is called, where I can have ImageViews, TextViews, all that such, in one ListView entry). How would I be able to do that with the following code that I have?
Cursor cursor...
I'm installing and configuring Eclipse Galileo 3.52 on a PC following the instructions on http://developer.android.com/sdk/eclipse-adt.html
All the steps in "Downloading the ADT Plugin" go fine with no errors. But when I get to the next step "Configuring the ADT Plugin" it fails when I set my SDK location, saying that it can't find an...
public void onSensorChanged(SensorEvent e) {
if (e.sensor.getType()==Sensor.TYPE_ACCELEROMETER) {
if(e.values[0] >= 8)
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
else
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
}
When the method is called...
Hallo,
My project was working fine, when suddenly the text on my buttons was being displayed vertically. By which I mean instead of map_infobutton displaying
Info
it was displaying
I
n
with the f and o beyond the bounds of the button, even though I have specified height=wrap_content in the TableLayout containing the buttons.
It a...
My XML looks like:
<key>A</key>
How do I extract the string "A" from the XML with java in Eclipse?
My Java code looks like:
XmlResourceParser xmlSymptoms = getResources().getXml(R.xml.symptoms);
while (eventType != XmlResourceParser.END_DOCUMENT) {
if (eventType == XmlResourceParser.START_TAG) {
// Get the...
Hey everybody,
i have an Android app and it supports sending text via other apps. It therefore uses the ACTION_SEND intent and the EXTRA_TEXT field. The chooser presents me with all apps that can handle such an intent. Those are Twitter, EMail, ... and Facebook. But when i select Facebook it opens the browser and goes to the following pa...
I am starting an activity and would rather have a alpha fade-in for startActivity(), and a fade-out for the finish(). How can I go about this in the Android SDK?
...
I am making a URLConnection to my companies server, and now that we have moved to the production server, I am receiving connection timeouts. It is known that the server is slow, so in order to accommodate it, I was asked to extend the amount of time before the connection times out on my device.
I checked my code, and saw that I had alre...
We have a variety of devices for testing purposes, and now that Froyo is being pushed (to the Nexus One so far at least), we have to constantly dismiss upgrade requests. There is no apparent "stop asking me" button.
So, is there any way I can disable OTA OS updates? We want a number of these phones to stay on old OS versions.
...
Hi Friends,
I want to create thumbnail image from its original image in coding for android
...
Hi,
I am adding different markers to my map...
Drawable drawable = app1.getResources().getDrawable(R.drawable.test);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
OverlayItem overlayitem2 = new OverlayItem(mark, "Test", "t");
overlayitem2.setMarker(drawable);
app1.mapOverlay.addOverlay(overlayit...
My question is, is it possible to call one app from another?
It would be very helpful if anyone had an answer or solution.
-Chris-
...
imgvw_back.setOnClickListener(this);
imgvw.setOnClickListener(this);
static id=10
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch(v.getId())
{
case R.id.back:
Log.v("back",""+id--);
break;
case R.id.forward:
Log.v("next",""+id++);
break; ...
I have a custom view (an extension of a TextView) that I want to dynamically add to my Layout (don't want to include it in the main.xml file).
The book says to fetch the RelativeLayout using findViewById() in my java code then create a new instance of my custom view, then use addView on the RelativeLayout to add the new view.
I'm not g...
friend's,
i have list view showing content initially with black color background ,during click event i have to change the content of list it getting data and all but the problem here is,the listview defaultlly getting black color background,but i need it to white color background,why it getting black color background by default wh...
Sorry, I know that this topic has been covered a bit. I've read the related posts and am still a bit confused. I am working on an app that while the prototype will have 3 main screens, it will eventually have dozens. Each screen will present either dynmically changing status or take user input. To visualize, it is required to be laid...
I'm writing some acceptance tests for an application using the ActivityInstrumentationTestCase2 class. I want to cause an orientation change from within the test to ensure that a number of things happen. Among these things are ensuring that Activity state is preserved, but also I'd like to ensure that the appropriate layout for the orien...
I have an android app written for my company and since its a private app, it is not in the android market. I'd like to be able to have the app check periodically for an update and if there is one notify the user and start downloading / installing the update.
Is there an example of something like this out there?
...