android-intent

Setting the Android System Volume

∥☆過路亽.° 提交于 2020-01-29 09:35:28
问题 I am writing an application which handles the following: Silent - Makes the phone volume silent Low - Makes the phone volume 1 point above the silent Medium - Makes the phone volume medium High - Makes the phone volume maximum Phone volume includes Ringer, video, audio , games volume etc. I know how to achieve Silent mode through AudioManager . But for 2-4 , I could not find any helpful code snippets. What do I need to do? 回答1: Add this in onCreate() method of your code and then play around

Setting the Android System Volume

大城市里の小女人 提交于 2020-01-29 09:33:25
问题 I am writing an application which handles the following: Silent - Makes the phone volume silent Low - Makes the phone volume 1 point above the silent Medium - Makes the phone volume medium High - Makes the phone volume maximum Phone volume includes Ringer, video, audio , games volume etc. I know how to achieve Silent mode through AudioManager . But for 2-4 , I could not find any helpful code snippets. What do I need to do? 回答1: Add this in onCreate() method of your code and then play around

RuntimeException: Unable to instantiate application

浪子不回头ぞ 提交于 2020-01-28 09:40:07
问题 When I run my application, everytime I am getting the below exception in my logcat: 04-14 09:29:53.965: W/dalvikvm(1020): threadid=1: thread exiting with uncaught exception (group=0x409c01f8) 04-14 09:29:53.985: E/AndroidRuntime(1020): FATAL EXCEPTION: main 04-14 09:29:53.985: E/AndroidRuntime(1020): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException 04-14 09:29:53.985: E/AndroidRuntime(1020): at android.app.LoadedApk

RuntimeException: Unable to instantiate application

二次信任 提交于 2020-01-28 09:38:25
问题 When I run my application, everytime I am getting the below exception in my logcat: 04-14 09:29:53.965: W/dalvikvm(1020): threadid=1: thread exiting with uncaught exception (group=0x409c01f8) 04-14 09:29:53.985: E/AndroidRuntime(1020): FATAL EXCEPTION: main 04-14 09:29:53.985: E/AndroidRuntime(1020): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException 04-14 09:29:53.985: E/AndroidRuntime(1020): at android.app.LoadedApk

save the state of button in android

六眼飞鱼酱① 提交于 2020-01-26 01:14:44
问题 am working on camera application i have two imageview one is auto and second is pro i want when i click on auto auto is selected and image icon changes and when i click on pro automatically auto view deselected and pro view is selected autobtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { autobtn.setImageResource(R.drawable.autoactive); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ModeActivity.this);

App called “NFC services” replacing my own app

自闭症网瘾萝莉.ら 提交于 2020-01-25 23:43:30
问题 I want my Android app to start after scanning an NFC tag, so to make some tests I modified the tiapp.xml of Favebooks (a simple tutorial app for Titanium) by adding the following lines: <android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <uses-permission android:name="android.permission.NFC"/> <uses-permission android:name="android.permission.CALL_PHONE"/> <uses-sdk android:minSdkVersion="14"/> <uses-feature android:name="android.hardware.nfc" android:required=

App called “NFC services” replacing my own app

天大地大妈咪最大 提交于 2020-01-25 23:41:53
问题 I want my Android app to start after scanning an NFC tag, so to make some tests I modified the tiapp.xml of Favebooks (a simple tutorial app for Titanium) by adding the following lines: <android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <uses-permission android:name="android.permission.NFC"/> <uses-permission android:name="android.permission.CALL_PHONE"/> <uses-sdk android:minSdkVersion="14"/> <uses-feature android:name="android.hardware.nfc" android:required=

App called “NFC services” replacing my own app

吃可爱长大的小学妹 提交于 2020-01-25 23:41:32
问题 I want my Android app to start after scanning an NFC tag, so to make some tests I modified the tiapp.xml of Favebooks (a simple tutorial app for Titanium) by adding the following lines: <android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <uses-permission android:name="android.permission.NFC"/> <uses-permission android:name="android.permission.CALL_PHONE"/> <uses-sdk android:minSdkVersion="14"/> <uses-feature android:name="android.hardware.nfc" android:required=

Get Image from Gallery with Intent

空扰寡人 提交于 2020-01-25 21:47:11
问题 I want to get a image from Gallery with the share command. My current code is: Intent intent = getIntent(); String action = intent.getAction(); String type = intent.getType(); if (Intent.ACTION_SEND.equals(action) && type != null) { Log.d("Test","Simple SEND"); Uri imageUri = (Uri)intent.getParcelableExtra(Intent.EXTRA_STREAM); if (imageUri != null) { InputStream iStream = getContentResolver().openInputStream(imageUri); } } else if (Intent.ACTION_SEND_MULTIPLE.equals(action) && type != null)

Android broadcast receiver not working when trying to receive bootcomplete or screen off

戏子无情 提交于 2020-01-25 20:31:09
问题 So I am trying to develop a custom lockscreen but my broadcastreceiver won't fire my manifest : <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.alexander.fuchs.lockscreen" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" >