intent

resolveUri failed on bad bitmap uri on Camera

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm having troubles while trying to create a bitmap from a Camera AND an Image Picker. I used a code that creates an Uri by the Camera so I added a condition to my function that already load pics from gallery. Here is the onActivityResult : protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RESULT_LOAD_IMAGE || requestCode == RESULT_CAMERA) { Uri selectedImage = null; if(requestCode == RESULT_LOAD_IMAGE) { selectedImage = data.getData(); }

Not allowed to bind to service Intent

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I write an android service of get weather, and the AndroidManifest.xml is: Now, I want let another apk to start this service: Intent service = new Intent(); service.setClassName("com.my.weather", "com.my.weather.WeatherService"); context.bindService(service, weatherServiceConnection, Context.BIND_AUTO_CREATE); And I got the error message: E/AndroidRuntime(14068): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.test/com.my.test.MainActivity}: java.lang.SecurityException: Not allowed to bind to service Intent { cmp

Not allowed to bind to service Intent

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I write an android service of get weather, and the AndroidManifest.xml is: Now, I want let another apk to start this service: Intent service = new Intent(); service.setClassName("com.my.weather", "com.my.weather.WeatherService"); context.bindService(service, weatherServiceConnection, Context.BIND_AUTO_CREATE); And I got the error message: E/AndroidRuntime(14068): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.test/com.my.test.MainActivity}: java.lang.SecurityException: Not allowed to bind to service Intent { cmp

Android storage access framework persistable permission not granted during asyntask

匿名 (未验证) 提交于 2019-12-03 01:46:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I set the intent flags here: public void createAlbum(View view) { Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); intent.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION); String intentChooserDialog = getResources().getString(R.string.pick_image_dialog); startActivityForResult(Intent.createChooser(intent, intentChooserDialog), PICK_IMAGE); } Here in my activity result I set the

第七次作业

感情迁移 提交于 2019-12-03 01:45:38
public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void click(View v) { EditText et1=(EditText)findViewById(R.id.eT1); String S= et1.getText().toString(); Intent intent=new Intent(); intent.setClass(this,SecondActivity.class); intent.putExtra("et1",S); startActivityForResult(intent,1); } protected void onActivityResult(int requestCode,int resultCode,Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode==1&

java.lang.SecurityException: Permission Denial: writing android.support.v4.content.FileProvider uri

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use camera and save image. Followed the steps as commonsware suggested. Constantly I am getting error - 2018-11-12 02:10:54.588 3145-3173/com.bisw.weac E/DatabaseUtils: Writing exception to parcel java.lang.SecurityException: Permission Denial: writing android.support.v4.content.FileProvider uri content://com.bisw.weac.provider/external_files/Android/data/com.bisw.weac/files/wallpaper/theme.jpg from pid=5566, uid=10071 requires the provider be exported, or grantUriPermission() at android.content.ContentProvider

Xamarin Form: Android doesn't received the broadcast after reboot

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Having problem receiving broadcast after reboot? I have a class receiving the broadcast after reboot like this. [ BroadcastReceiver ( Enabled = true , Exported = true , Permission = "RECEIVE_BOOT_COMPLETED" )] [ IntentFilter ( new string [] { Android . Content . Intent . ActionBootCompleted })] public class StartupBootReceiver : BroadcastReceiver { public override void OnReceive ( Context context , Intent intent ) { var startupIntent = new Intent ( Application . Context , typeof ( StartupService )); Application . Context .

Nfc and Intent-filter

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I wrote a nfc text tag like this myscheme://company?page=2&poiId=140 Then i've created an Intent-filter like this in my manifest file in order to open my app (and then call a WS with informations from tag) <intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="text/plain" android:scheme="myscheme" android:host="company"/> </intent-filter> If i remove scheme and host params from data tag so everything works but by adding filtering it does

Android: Difference between Parcelable and Serializable?

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Why does Android provide 2 interfaces for serializing objects? Do Serializable objects interopt with Android Binder and AIDL files? 回答1: In Android we know that we cannot just pass objects to activities. The objects must be either implements Serializable or Parcelable interface to do this. Serializable Serializable is a standard Java interface. You can just implement Serializable interface and add override methods.The problem with this approach is that reflection is used and it is a slow process. This method create a lot of temporary objects

Failure delivering result ResultInfo{who=null, request=2, result=0, data=null} camera

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: here is the camera code private void selectImage(){ final int Camera_CPTURE = 1; try { Intent capture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(capture,Camera_CPTURE); }catch (ActivityNotFoundException e) { String error ="opps ur devices doesn't support capturing"; Toast toast = Toast.makeText(this,error,Toast.LENGTH_SHORT); toast.show(); } } protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == RESULT_OK) { picUri = data.getData(); performCrop(); } else if(requestCode =