android-intent

How do i resolve NullPointerException when calling methods?

可紊 提交于 2020-01-15 13:33:31
问题 I'm a noob to android and i am having an issue calling a method from another class. The method works works fine when called from within its own class, but i get a nullpointerexception when i call it from another class. Any help would be greatly appreciated. Here is my code; Calling method in class1 from class2: BottlesActivity inst = new BottlesActivity(); inst.call0(); Method in class 1: public void call0() { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri

Cropping captured image is blur in android

时光总嘲笑我的痴心妄想 提交于 2020-01-15 12:38:07
问题 Hi basically I am selecting image form gallery or capture from camera and cropping it. If I crop image which is selected from gallery is no blur its fine but if I crop captured images means its getting blur. To start camera I have used private void cameraIntent() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, REQUEST_CAMERA); } and in camera onActivityResult private void onCaptureImageResult(Intent data) { Bitmap bm = (Bitmap) data.getExtras()

Android intent Filters: better as constant or in String.xml

此生再无相见时 提交于 2020-01-15 12:09:13
问题 I am working on my first Android Project. I have a Service class that waits for receive intents to retrieve some information from a remote server. This service of mine looks something like this: public class MyService extends IntentService{ public static final String ACTION_INTENT_01 = "xyz.actionIntent01"; public static final String ACTION_INTENT_02 = "xyz.actionIntent02"; public static final String ACTION_INTENT_03 = "xyz.actionIntent03"; ... A lot of constant more... public static final

Android intent Filters: better as constant or in String.xml

为君一笑 提交于 2020-01-15 12:08:40
问题 I am working on my first Android Project. I have a Service class that waits for receive intents to retrieve some information from a remote server. This service of mine looks something like this: public class MyService extends IntentService{ public static final String ACTION_INTENT_01 = "xyz.actionIntent01"; public static final String ACTION_INTENT_02 = "xyz.actionIntent02"; public static final String ACTION_INTENT_03 = "xyz.actionIntent03"; ... A lot of constant more... public static final

Intent with ListView (JSON data)

泪湿孤枕 提交于 2020-01-15 11:37:13
问题 I put JSON data to the ListView. I want data in the list("ItemTitle", "ItemText", "latit", "longit", "date") can transfer to another activity(result.java)when item is clicked. Here are the code: activity: public class Earthquake extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.earthquake); getData(); } private void getData() { // TODO Auto-generated method stub ListView list = (ListView)findViewById(R.id

How to send an email in android 2.2?

若如初见. 提交于 2020-01-15 10:57:05
问题 I want to send an email with android 2.2. First I made an intent chooser with an ACTION_SEND to select which to use : Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_SUBJECT, Resources.getString("EmailInvitationSubject", getBaseContext())); String body = Resources.getString("EmailInvitationBody", getBaseContext()) + Local.User.FirstName; intent.putExtra(Intent.EXTRA_TEXT, body); startActivity(Intent.createChooser(intent, "Invite

Is System Permission required for android.intent.action.CALL_PRIVILEGED?

流过昼夜 提交于 2020-01-15 10:48:48
问题 I am try to use "android.intent.action.CALL_PRIVILEGED" to run USSD code in android but it throw SecurityException even i am using required permission. Code : String encodedHash = Uri.encode("#"); String ussd = "*141" + encodedHash; startActivityForResult(new Intent("android.intent.action.CALL_PRIVILEGED", Uri.parse("tel:" + ussd)), 1); AndroidManifest.xml : <uses-permission android:name="android.permission.CALL_PRIVILEGED"></uses-permission> But still I am getting SecurityException Exception

android How to switch between Intents

故事扮演 提交于 2020-01-15 10:37:28
问题 I have 3 activities. start / game / finish, I want to go start to game, game to finish, finish to start. but when I use Intent one to another when I finish() "finish" Its come back to game. It should come back to start. so It needs a design kind of all Intents under start activity. so I tried this one and expected when I finish() "finish" application will be destroy but It didnt work Intent intent = new Intent(getApplicationContext(),FinishScreen.class); startActivity(intent); Q: so how can I

Android Facebook sdk messaging ID mismatch

﹥>﹥吖頭↗ 提交于 2020-01-15 10:33:27
问题 I am developing an android app using Parse. When a user registers I store his/her Facebook ID in a column. I have an option in my app where Facebook friends can contact each other using the fb messaging app. I am using the following code to open the messaging app directing to the correct user: String id = user.getFacebookId(); startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("fb://messaging/" + user.getFacebookId()))); When I use this ID as follows: https://www.facebook.com

Using the default android image Viewer to show pics

流过昼夜 提交于 2020-01-15 06:57:19
问题 I know that I can open an image using the default android image Viewer, for example with new Intent(Intent.ACTION_VIEW) etc. If I open the image and then I swipe left/right I'll see the other images saved on the device. For example, if I open one of whatsapp images, swiping left/right I'll see all other images saved inside whatsapp folder. Is there a way to pass the default android image Viewer a List / Array of uri, in order to prevent users from swiping left/right and see all the images on