android-activity

scrollview in RelativeLayout --android

好久不见. 提交于 2020-01-07 05:53:32
问题 i have one RelativeLayout and i have some views(image and edittexts) and now i want to use scrollview.this is a my xml code <RelativeLayout android:id="@+id/relativeLayout2" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:layout_marginTop="70dp" > <ImageView android:id="@+id/loginbtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@

LoaderCallbacks.onLoadFinished not called if activity is not active

﹥>﹥吖頭↗ 提交于 2020-01-07 05:30:29
问题 I have two activities who read the same database table. In activity A I have an AsyncTaskLoader and LoaderCallbacks objects with the following onLoadFinished code (in Scala): def onLoadFinished(loader: CursorLoader, cursor: Cursor) = { android.util.Log.d(TAG, "got results") cursor.setNotificationUri(ct.getContentResolver, observePath) cursor registerContentObserver new ContentObserver(new Handler) { override def onChange(selfChange: Boolean) = { android.util.Log.d(TAG, "change registered") if

Android - java.lang.classcastexception android.app.application cannot be cast

允我心安 提交于 2020-01-07 03:15:16
问题 I'm an Android newbie, and I'm building an android app about tutorial and I want to include game features in it, I already have the source code for the game and i already import all the classes to my project, however when i try to run the app i got an error and it said "android.app.application java.lang.ClassCastException can not be cast to com.wglxy.example.dash1.ChuckApplication", i assume that is because i fave 2 activity called HomeActivity.java (Main) and ChuckApplication.java (second)

Activity has leaked window?

人走茶凉 提交于 2020-01-07 03:15:08
问题 I am having one java class in that class as soon some one purchases our application then it will start downloading and progress dialog has to appear instead it goes to some other page and when i come out of the application and when i restart then it starts downloading. Please Help me out from this mess... Thank you 回答1: Check the condition for dialog, before showing. Like this if(pDialog!=null) { if(!pDialog.isShowing()) { pDialog.show(); } } and also while removing the dialog in

Activity has leaked window?

你。 提交于 2020-01-07 03:14:05
问题 I am having one java class in that class as soon some one purchases our application then it will start downloading and progress dialog has to appear instead it goes to some other page and when i come out of the application and when i restart then it starts downloading. Please Help me out from this mess... Thank you 回答1: Check the condition for dialog, before showing. Like this if(pDialog!=null) { if(!pDialog.isShowing()) { pDialog.show(); } } and also while removing the dialog in

AppCompat does not support the current theme features

一世执手 提交于 2020-01-07 03:07:24
问题 Studio gives me error like below . How can I solve this? I tried other solutions . But they dont work. emulator's API : 21 . All Other API's works. But in this gives me error . When I click an item in the Navigation drawer menu , it crashes Error Output : java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dd.myApplicaiton/com.d.myapplication.category.CategoryActivityDialog}: java.lang.IllegalArgumentException: AppCompat does not support the current theme features: {

Releasing mediaplayer and stopping it onPause and onResume gives error in Android

心不动则不痛 提交于 2020-01-07 02:50:31
问题 i m using videoView and mediaplayer but stopping mediaplayer in onPause and onResume gives me error: static MediaPlayer mediaPlayer; private VideoViewCustom videoView; @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detailvideo); context = this; videoView = (VideoViewCustom) findViewById(R.id.videoplayer); //initialize media player mediaPlayer = new MediaPlayer(); videoView.setOnPreparedListener(new

Populating a list view from another list view

不问归期 提交于 2020-01-07 02:18:10
问题 I need to achieve this: I have a sqlite table with this data slno Type Level_1 Level_2 Level_3 1 Animals Cat Null /sdcard/Video 2 Animals Cat Null /sdcard/PDF 3 Birds Aves HummingBird /sdcard/video I should have a list view with Animals and Birds , clicking on Animals shows me Cat, while Bird shows me Aves. Then so on until the content - which has to be played depending on the type. Now this can be achieved by creating a lot of Activities say for Animals level - pass level_1 for Activity_2

How to make a splash screen efficiently

半腔热情 提交于 2020-01-07 01:11:10
问题 I am trying to make splash screen for my app so that I can load some data in when I am showing the splash screen .But seems there are many way of making a splash screen. 1.Make a new activity with a layout and show that activity for some time.But making another activity with a layout makes the app heavy. 2.Make a new activity with no layout and making a splash screen back ground instead as shown here 3.Make a fragment with a layout and show them as splash screen as shown here Among all these

How to start the activity that is last opened when launch an application?

孤者浪人 提交于 2020-01-06 23:57:34
问题 I designed an app with several activities. There is only an activity instance in the back stack at any time. When I quit the application from an activity named AcitivityOne, how could I launch the application with ActivityOne next time? 回答1: The fast method, is that in your onCreate() put those flags after setContentView() : if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) { finish(); return; } Also you can create a SharedPreferences with the Activity last oppened as