android-intent

Intent ACTION_SEND doesn't show every browser

久未见 提交于 2019-12-25 03:59:09
问题 I have a button which fires a ACTION_SEND intent when clicked as below: private static final String WEB_URL = "https://www.google.ca/"; @Override public void onClick(View v) { Intent intent = new Intent(); intent.setAction(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_TEXT, WEB_URL); intent.setType("text/plain"); startActivity(Intent.createChooser(intent, "CHOOOOOSE")); } Currently, it has some other apps, 'Copy to clipboard', and 'Add to Firefox' which can be used to open the link in

how to show progress in android

余生颓废 提交于 2019-12-25 03:45:30
问题 i am new in android and i want to display progress when moving from one activity to other activity in android here is the code.Exception is "Activity com.example.mytest.ReadContactsActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{40ce4900 V.E..... R.....I. 0,0-295,62} that was originally added here" class MyTask extends AsyncTask<Void, Integer, Void> { Dialog dialog; ProgressBar progressBar; TextView tvLoading,tvPer; @Override protected void onPreExecute() {

not able to align two text views on the same line in android

。_饼干妹妹 提交于 2019-12-25 03:39:36
问题 The xml file is, <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:id="@+id/profileLayout"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Super Powers" /> </LinearLayout> and in Activity file i am trying to add one text feild whose value will change dynamically (value

Unable to convert List data transmitted through Android intent into String array

大兔子大兔子 提交于 2019-12-25 03:28:53
问题 I'm an Android newbie. I'm trying to pass data from one activity to another. The data is of type List. It is received properly by the recieving activity. However I'm unable to make a string array out of it. What am I doing wrong? This is the transmitting activity List<String> where = new ArrayList<String>(); intent.putStringArrayListExtra("tokeo", (ArrayList<String>) where); startActivity(intent); The first log statement correctly prints what I expect it to. However the toast and the

Xamarin Android: get one app's state information from another

时间秒杀一切 提交于 2019-12-25 03:22:59
问题 I have two Xamarin Android apps -- let's call them "Archy" and "Mehitabel". Archy has some persistent state information (which, let's say for the sake of argument, is in a SQLite DB). If a certain thing happens to Mehitabel, she needs to know a piece of that state information. To accomplish this feat, I have Mehitabel send an intent to Archy. Archy has a broadcast receiver that hears it, gathers the necessary state, and fires a different intent back to Mehitabel. Here's the code from Archy:

Android Wear Message Listener

霸气de小男生 提交于 2019-12-25 03:14:08
问题 I need some help I have Android Wear with message api working but I'm stuck sending some commands this is my listener. import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.hardware.Camera; import android.widget.ImageButton; import android.widget.Toast; import com.google.android.gms.wearable.MessageEvent; import com.google.android.gms.wearable

Button to start the Gallery on Android

人盡茶涼 提交于 2019-12-25 03:09:02
问题 I'm trying to make a button in my App open the built in gallery. public void onClick(View v) { Intent intentBrowseFiles = new Intent(Intent.ACTION_VIEW); intentBrowseFiles.setType("image/*"); intentBrowseFiles.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intentBrowseFiles); } This results in an error message "The application Camera (process com.android.gallery) has stopped unexpectedly." If I set the Intent action to ACTION_GET_CONTENT it manages to open the gallery but then simply

onactivityresult not getting called while using Gallery in android

你。 提交于 2019-12-25 02:44:20
问题 I am opening a gallery in my Android Application using this code. Intent intent = new Intent(Intent.ACTION_PICK, Media.EXTERNAL_CONTENT_URI); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivityForResult(intent, GALLERY); It opens gallery but when I am selecting any Image from there its closing also but not called onActivityResult method. Method is here.... protected void onActivityResult(int requestCode, int resultCode, Intent data) { Log.v(TAG, "requestCode = "+requestCode+"

How to use long press in android custom imageview?

徘徊边缘 提交于 2019-12-25 02:44:15
问题 I am using custom imageview for zoom in image. zoom in and zoom out works well but i need to tap for long click listener to handle this but i couldn't use , long click listener. I used some delay to test but still not working. How to solve this? here is custom ImageView for zoom in import android.content.Context; import android.graphics.Matrix; import android.graphics.PointF; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.util.Log; import android

How to pass string in webview url from edittext

北城以北 提交于 2019-12-25 02:42:08
问题 I have two activity MainActivity.java and WebViewActivity.java in MainActivity there is a edittext and a button. Now i want if i enter any string in edittext and after button click it should pass that string into url in WebViewActivity like www.mywebsite.com+getTestFromEdittext MainActivity.java super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); EditText inputUrl = (EditText) findViewById(R.id.editText1); Button button = (Button)findViewById(R.id.button1); button