android-activity

Communicating between a fragment and an activity - best practices

强颜欢笑 提交于 2020-01-06 07:07:38
问题 This question is mostly to solicit opinions on the best way to handle my app. I have three fragments being handled by one activity. Fragment A has one clickable element the photo and Fragment B has 4 clickable elements the buttons. The other fragment just displays details when the photo is clicked. I am using ActionBarSherlock. The forward and back buttons need to change the photo to the next or previous poses, respectively. I could keep the photo and the buttons in the same fragment, but

onActivityResult NOT called in MainActivity from previous Activity

我是研究僧i 提交于 2020-01-06 06:39:07
问题 I know this is a basic question and I have seen multiple answers on it in stackoverflow but I seem to be stuck still. The onActivityResult is just not being called. Here is my code: 1> In MainActivity I have onActivityResult public class MainActivity extends AppCompatActivity implements MasterListFragment.OnImageClickListener { @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); Log.v(LOG

onActivityResult NOT called in MainActivity from previous Activity

久未见 提交于 2020-01-06 06:36:32
问题 I know this is a basic question and I have seen multiple answers on it in stackoverflow but I seem to be stuck still. The onActivityResult is just not being called. Here is my code: 1> In MainActivity I have onActivityResult public class MainActivity extends AppCompatActivity implements MasterListFragment.OnImageClickListener { @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); Log.v(LOG

how to add button or Menu in Contacts list?

▼魔方 西西 提交于 2020-01-06 06:02:57
问题 I am using following code to open Android Contacts @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); btnContacts = (Button) findViewById(R.id.btn_contacts); txtContacts = (TextView) findViewById(R.id.txt_contacts); btnContacts.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { txtContacts.setText(""); Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI); startActivityForResult

How to reuse intents in Android

℡╲_俬逩灬. 提交于 2020-01-06 05:49:05
问题 Hello All: I am creating an application in which I am using menus on every screen for the user to navigate. In my application, I have Screen1--> comes as home screen when the user logs in Screen2--> user goes to this screen to perform some operations. Now on Screen2 I want to have menu option to let the user go to home screen. But to start the activity we do startActivity(new Intent(Home.this, Screen2.class)); But, I want to use the existing home screen which was created when the used logged

How to send an object to another activity with special stuff?

别来无恙 提交于 2020-01-06 04:22:24
问题 I am developing a math app for kids. After the user customizes the question options, I want to start another activity. I want to send a QuestionOptions object to the activity so that it can generate questions according to the options. So I created a QuestionnOptions class and implement Parcelable as the other answers showed me. However, there is an enum in my class. So I don't know what to do and let Android Studio generate the stuff needed: package com.smartkidslovemaths; import android.os

Android full screen not working when activity is launched by a service

淺唱寂寞╮ 提交于 2020-01-06 03:03:07
问题 So I am developing an alternate lockscreenapp and I need to prevent clicking the notificationbar so I try to run this app in fullscreenn but when it is calle by a service the notificationbar is still their when it is called by the launcher it get invisible Code: public class app extends Activity { TextView datum; static TextView time; static TextView temperature; static ImageView weather_icon; static TextView weather_refreshed; static RelativeLayout refresh; private static Context mContext; /

AIR app, adding activity to manifest changes the app design

社会主义新天地 提交于 2020-01-06 02:52:08
问题 I have a small problem, probably because I'm a newbie in Android development. I am making an Air mobile App, with an Air Native Extension. My extension is used to create alarms. In my BroadcastReceiver I make an Intent to call my Air App. To make this call possible I had to add the activity in my Air App Manifest like this : <manifestAdditions><![CDATA[ <manifest> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.VIBRATE"/> <uses

Activity layout inheritance

梦想的初衷 提交于 2020-01-06 02:50:14
问题 I start develop application on Android! I need to show common control on the top of few screens. In Blackberry I just inherit my screens from base screen with needed controls and it inherit UI and behaviour from base type. How can i do similar thing in Android? I mean, how can i organize it? Maybe, i need to create control or layout, which i can use on my screens? Or i need inherit one activity from another and use addContentView()? What opportunities are there and what advantages /

Android: how to disable top left back button from SubSettings

主宰稳场 提交于 2020-01-06 02:15:14
问题 From Android Jellybeans, all sub-activities of Settings activity are having this back button at top left corner which calls the Settings activity. It behaves more like a 'up' button for navigation purpose. I have android code, and I want to disable this button for few sub-activities like display, sound etc. in my build. Any suggestions, where do I have to modify to disable this? I tried out removing android:parentActivityName tag from particular Activity in the Manifest file, but it didn't