activity

Android activity crash (DeadObjectException)

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Here is my logcat details please help me out in this 03 - 28 11 : 58 : 13.421 992 - 5910 /? D / ActivityManager : New dropbox entry : com . dpc . selfie , data_app_native_crash , 5f2d762f - 9b90 - 42d2 - 8a2a - bda978da87bc 03 - 28 11 : 58 : 13.431 992 - 5910 /? W / ActivityManager : Force finishing activity com . dpc . selfie /. Act . Activity_Feeds 03 - 28 11 : 58 : 13.461 992 - 1177 /? W / InputDispatcher : channel '4443fea0 com.dpc.selfie/com.dpc.selfie.Act.Activity_Feeds (server)' ~ Consumer closed input channel or an error

ERROR: must implement OnFragmentInteractionListener

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: It's trowing an error saying I must implment the OnFragmentInteractionListener, but as far as I'm aware I'm implementing it properly ... Any help would be greatly appreciated. Main Activity import android.app.Activity; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.os.Bundle; public class MainActivity extends Activity implements NavFragment.OnFragmentInteractionListener, ContentFragment.OnFragmentInteractionListener{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

getApplicationContext() error Android

匿名 (未验证) 提交于 2019-12-03 01:19:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a fragment that allows a user to enter in a message and a phone number to which the message will be delivered. I am getting an error "cannot resolve method getApplicationContext()" I have looked at the answer here the method getApplicationContext() is undefined but it didn't help me, maybe I am implementing it wrong but I am not sure! This code works fine as an activity but not as a fragment. FragmentTab1 class package com . androidbegin . absfragtabhost ; import android . content . Context ; import android . os . Bundle ;

android.content.Context.getPackageName()' on a null object reference

匿名 (未验证) 提交于 2019-12-03 01:19:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Hi I am working with Fragments which implements an interface. public class SigninFragment extends Fragment implements SigninInterface The interface's method implementation in the fragment class is as follows. @Override public void afterSubmitClicked ( String userId , Bundle bundle ) { Log . d ( TAG , "Calling time afterSubmitClicked called" + bundle ); if (! userId . equals ( "-1" )){ //Logged in successfully //Move to MusicHome Intent mIntent = new Intent ( getActivity (), MusicHome . class ); mIntent . putExtra ( "SigninFragment

Disable activity slide-in animation when launching new activity?

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have an activity which launches another activity, via a button click. By default, on newer OS versions of android, the OS will animate the new activity sliding in from right to left. Is there a way to disable this animation? I just want the new activity to appear without any sort of animation. 回答1: The FLAG_ACTIVITY_NO_ANIMATION flag works fine for disabling the animation when starting activities. To disable the similar animation that is triggered when calling finish() on an Activity, i.e the animation slides from right to left

How to get running application activity Name in android 5.0(L)?

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the following code to get the current running activity name in android. ActivityManager am = (ActivityManager) aContext .getSystemService(Context.ACTIVITY_SERVICE); List alltasks = am .getRunningTasks(1); ComponentName componentInfo = alltasks.get(0).topActivity; componentInfo.getClassName(); System.out.println("Current:"+componentInfo.getClassName()); This is working fine in all the versions below android 5.0 . But in Android 5.0 it always returning the launcher activity . Please any one help in this because I want to make run

Android: making a fullscreen application

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the simplest change that I can make to a new Blank Activity, as created by the latest version of Android Studio, to get the app to appear fullscreen? I want to create a fullscreen Android application. I'm working with Android Studio. This post suggests that I add a line such as ... android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" ... to the AndroidManifest.xml file, as shown below: When I do this, the app compiles but it crashes on launch. If I remove the line, the app runs fine, but with the action bar and a

Activity with fragments does not resize when the keyboard opens

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my main activity there is a RelativeLayout that has 2 childs: An ImageView which serves as the background A LinearLayout that has 2 fragment containers activity_main.xml Container A simply shows a fragment that doesn't change. However, Container B holds a fragment that does change depending on user clicks. Container B changes in 2 ways: It can expand (from a height of about 70% to full height). It changes fragments. One of the fragments Container B can hold is a form, which contains EditText s and other views. My problem is that I can't

native insert query in hibernate + spring data

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tries to add following code to spring data jpa repository: @Query("insert into commit_activity_link (commit_id, activity_id) VALUES (?1, ?2)") void insertLinkToActivity(long commitId, long activityId); But app can't start with exception: Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: VALUES near line 1, column 59 [insert into commit_activity_link (commit_id, activity_id) VALUES (?1, ?2)] Where i'm wrong? 回答1: I had to add nativeQuery = true to @Query @Query(value = "insert into commit_activity_link

Close Activity Using BroadcastReceiver

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: i have one activity Main.java is open in my application, i want to close the activity using broadcast receiver , how to close the activity? 回答1: Firstly your Main.java needs to be registered as a receiver. You could register it in Main.java's onResume(): @Override public void onResume () { registerReceiver ( broadcastReceiver , new IntentFilter ( BroadcasterClassName . NAME_OF_ACTION )); } Then handle the broadcast and finish your activity: private BroadcastReceiver broadcastReceiver = new BroadcastReceiver () { @Override public