Skip to content
Advertisement

Tag: android

Get Android Device Name

How to get Android device name? I am using HTC desire. When I connected it via HTC Sync the software is displaying the Name ‘HTC Smith’ . I would like to fetch this name via code. How is this possible in Android? Answer In order to get Android device name you have to add only a single line of code:

How to change menu item text dynamically in Android

I’m trying to change the title of a menu item from outside of the onOptionsItemSelected(MenuItem item) method. I already do the following; however I’d like to be able to modify the title of a particular menu item outside of this method. Answer As JxDarkAngel suggested, calling this from anywhere in your Activity, and then overriding: is a much better choice.

Android: location; activity and service

I’m working on some application that should fetch current location and after device is located in some radius should be shown application with some message. I have a few questions. I’m trying to fetch location using If I use requestLocationUpdates then GPS is always working. And this is a waste of battery. Maybe there is some way, for example, to

How to find root of memory leaks?

My app is basicly and image editor. There is a welcome page which opens main activity with an intent. If orientation changes when main activity is working the memory consumption simply doubles up and remains that way. If i close the main activity turn back to welcome activity and start main activity again same problem does not occur. I think

Limit Decimal Places in Android EditText

I’m trying to write an app that helps you manage your finances. I’m using an EditText Field where the user can specify an amount of money. I set the inputType to numberDecimal which works fine, except that this allows people to enter numbers such as 123.122 which is not perfect for money. Is there a way to limit the number

Advertisement