android-activity

ACTION_SEND intent android

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 05:06:09
问题 I am trying to pass a url to a specific app using the ACTION_SEND intent, I want to by pass the chooser and just go straight to the app i desire but it doesn't seem to take the url unless i use the chooser.. private void shareIt(){ Intent pC = new Intent(Intent.ACTION_SEND); pC.setType("text/plain"); pC.putExtra(Intent.EXTRA_TEXT, "http://www.bob.com"); pC.setType("text/plain"); pC.setClassName("com.sec.print.mobileprint","com.sec.print.mobileprint.UI.WebPrint"); //startActivity(pC);

Resume after pressing 'Home' should start my Startactivity

爷,独闯天下 提交于 2020-01-03 04:54:34
问题 I want my app to have a password-query. This should be displayed every time the app is started or resumed. So I have declared a Startactivity that shows a password prompt. If the user closes the App by pressing 'Back'-hardware Button some times everything is fine. But if the user pauses the app by pressing 'Home' the app opens in the activity displayed before without showing my prompt. 1)What is the best way to implement this as I want? Maybe doing something in OnStop() of each activity but

Dynamically load layout in Android

巧了我就是萌 提交于 2020-01-03 04:49:09
问题 My application requires 2 screens and for this I have created two different XML layout files using RelativeLayout . One layout file loads whenever I run my Activity. Now I want to load the second layout on to the same Activity , when user click on a button in OptionsMenu and also when user press Back button the first screen loads instead of exiting the application. So that i don't need to create another Intent in my application. 回答1: Ideally there should be two different activities present in

Access the current android activity

时光毁灭记忆、已成空白 提交于 2020-01-03 04:09:06
问题 How can I access the current Android activity class? I am using the necessitas framework (QT in Android). Basically, using the Android NDK an activity calls a QT application (.so). All runs fine. Now I am working on some bindings to access the GPS from the QT application. From some java examples that access the GPS I saw that the most vital part is to allow access to the GPS service: LocationManager lm; lm = (LocationManager) getSystemService(LOCATION_SERVICE); Here getSystemService is a

Non-continuous Rendering in Loading screen not working as it supposed to work - Multithreading LIBGDX

♀尐吖头ヾ 提交于 2020-01-03 03:12:04
问题 I'm using Non-continuous Rendering in my loading screen so I can update it as I INIT different parts of my code in a secondary thread. That way I can manually increase the Animation counter that I use to draw a Sprite which shows a filling hourglass in tune with the loading of my assets. So, I load my game screen with the help of another thread (atlases, textures, init variables,etc) : Runnable load_game_screen = new Runnable(){ public void run(){ new_game_screen.load_all(); } }}; Thread

Creating activity with 3 fragments

∥☆過路亽.° 提交于 2020-01-03 02:49:21
问题 I currently have an application for my phone which uses a tab navigation actionbar to navigate between three fragments. I now want to create a tablet equivalent of this app, but instead of using the actionbar, I want the three fragments living next to each other. So each fragment would fill up 1/3th of the screen. The problem is, I can't figure out how to approach this. I've thought of using the Design part of Android Studio to create placeholders, then use the onCreate() method to fill those

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

calling activity from external Activity

*爱你&永不变心* 提交于 2020-01-03 02:05:13
问题 I'd like to start an Activity which is not included in my original .apk. How can I do so? the other Activity is contained in another .apk which is previous version of the current application. Thanks, Eyal. 回答1: This method is good if you only know the package name: PackageManager pm = getPackageManager(); Intent intent = pm.getLaunchIntentForPackage("com.the.other.app"); startActivity(intent); 回答2: I'd suggest you read through the Application Fundamentals first - as far as I'm concerned, you

Will this work on all screen sizes?

≡放荡痞女 提交于 2020-01-03 01:58:08
问题 I've been doing lots of research lately on optimizing my app for all screen sizes. I've created 9 of every layout in order to fit every size. Don't worry about those other two layouts that are just in the layout directory, I will make 8 more of those later (Android view) Some articles say to have more layouts, but of what? Am I missing something? Did I do this correctly? I have some doubt about my screen sizes, as lots of people on the internet have different ways of targeting different

Start with different activity on first launch of android app

谁说胖子不能爱 提交于 2020-01-02 23:03:40
问题 Is there a way to launch a different activity on startup once only? If I instantly launch my setup activity from my main activity, there is a 1 second pause with a white screen. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent myIntent = new Intent(this, home2.class); this.startActivity(myIntent); finish(); ... } 回答1: That can be done in several ways. One of them is usage of the shared preferences