android-intent

Start Android activity from list of activities

自闭症网瘾萝莉.ら 提交于 2020-01-03 04:38:08
问题 I am working on one android app, and in which i have one menu that shows list of Activity name.Upon clicking of any item from menu should start that specific Activity. One way i know to do this is, String classes[]= {"firstActivity","DetailActivity"}; intent i =new Intent(pkg_name+classes[position]);startActivity(i); where position=0 or 1. And for that i need to write in AndroidManifest.xml file below code for each Activity <activity android:name="com.example.day1.DetailActivity" > <intent

access website within android code and retrieve a generated image

不羁岁月 提交于 2020-01-03 02:51:07
问题 This description was very hard to word. Basically I want to know if it is possible to access a website inside Android coding without actually sending the user to that website. What I want to do is use a free website that generates a random pic after you upload your picture to it. I want the user to be able to upload their selected image to the website, and I guess somehow in code make that website generate an edited image and retrieve it back into the application for further use. I know this

ActionBar Up button: go to previous Activity with prev fragment

≯℡__Kan透↙ 提交于 2020-01-03 02:49:16
问题 I need your help regarding my application flow. MainActivity (with Navigation Drawer) -- Fragment A -- Fragment B -- Fragment C (articles list view) ArticleActivity -- Fragment D (article detail view) Fragment C ( MainActivity ) displays a list of items ( ListView ). Selecting an item leads to fragment D (handle by ArticleActivity ) which presents that item in more detail. Fragment D displays a "Up" button that should allow the user to returns to previous screen (the detail view). The problem

Attaching a file from secure storage in Gmail from my app

喜夏-厌秋 提交于 2020-01-03 02:43:05
问题 My app has an option to send out the log, which is store in the app's secure storage. The path to the file is "/data/data/com.mycompany.myapp/files/log.zip". The file's permissions have been chnged to MODE_WORLD_READABLE, and the intent to launch email is: Intent i = new Intent(Intent.ACTION_SEND); i.setType("application/zip"); i.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///data/data/com.mycompany.myapp/files/log.zip)); startActivity(Intent.createChooser(i, "Send Error Log")); If the file

sendBroadcast does not get called in Activity when Activity is opened

别来无恙 提交于 2020-01-03 02:29:11
问题 I am making an app where I receive XMPP packets. My app starts in foreground and starts a Sticky Service if not started and start receive messages in backgrounds and make notifications of them. The notifications works well and when clicked they show the data. Issue comes (that too sometimes in some mobile phones) when I make a sendBroadcast call from service so that I can asynchronously update the text of message in Activity when it is opened. My app is made with a Activity and within that

Sl4A Broadcasting an Intent to Minimalistic text widget

≡放荡痞女 提交于 2020-01-03 02:12:41
问题 I have been attempting to send variable data directly from SL4A to Minimalistic Text Widget using sendBroadcastIntent much like how I can send variables to Tasker (Using code I found on the SL4A google groups) Unfortunately my understanding of intents is a little lax and I have found locating tutorials specifically in relation to SL4A almost impossible. The SL4A makeintent API Reference The minimalistic Test Intent example The code I have attempted to use: import Android droid = Android()

Start Activities Randomly in Android

我是研究僧i 提交于 2020-01-03 01:44:24
问题 I have 9 Activities (It can be increased more than this not a fixed value) in my App on Click of the Button i want to start activities randomly.Like Activity 1 -> Activity ->3 and so on. And if the user clicks on the back button i want to finish the current activity and start again a new activity the the user haven't been visited yet .. So how could i do this . For random activity i have tried this way Random rnd = new Random(); int x=rnd.nextInt(9)+1; Intent myIntent = new Intent(); switch(x

How to send email with attachment using default Android email app - Delphi XE7

两盒软妹~` 提交于 2020-01-02 18:07:12
问题 Using code below which I found on another post, the email appears ready to send with the attachment, but when email is received, there is no attachment. Also, the email address has to be manually entered, it is not populated by the CreateEmail statement. I am sending from a gmail account. Anyone help please? procedure TForm1.CreateEmail(const Recipient, Subject, Content, Attachment: string); var Intent: JIntent; Uri: Jnet_Uri; AttachmentFile: JFile; begin Intent := TJIntent.Create; Intent

How to send email with attachment using default Android email app - Delphi XE7

帅比萌擦擦* 提交于 2020-01-02 18:07:10
问题 Using code below which I found on another post, the email appears ready to send with the attachment, but when email is received, there is no attachment. Also, the email address has to be manually entered, it is not populated by the CreateEmail statement. I am sending from a gmail account. Anyone help please? procedure TForm1.CreateEmail(const Recipient, Subject, Content, Attachment: string); var Intent: JIntent; Uri: Jnet_Uri; AttachmentFile: JFile; begin Intent := TJIntent.Create; Intent

Start Activity of Main project from my library project

陌路散爱 提交于 2020-01-02 17:54:14
问题 I have 2 projects. One is my Main Project(A) , and another is a Library Project(B). I want to start an activity which is present in A from an activity which is located in B. How do I do that ? I Tried startActivity(getApplicationContext(),B.class); ,but B.class is not resolved. How Can I let my library project start an activity of my main project ? 回答1: You can add custom Action in intent-filter of you activity and start that activity by specifying action <activity android:name="my.package