fragment

<Input type=“file”> not working in my WebView

…衆ロ難τιáo~ 提交于 2021-02-19 08:21:53
问题 I develop Fragment WebView Application. I use upload code in Fragment WebView. When I click <input type="file"> it is active nothing. logcat show only this warning 05-22 15:59:39.749 31611-31611/kr.nubiz.comn W/cr_Ime: updateState: type [0->0], flags [0], show [false], How can I solve this problem? WebView - Fragment private void initLayout() { handler = new Handler(); webView = (android.webkit.WebView) rootView.findViewById(R.id.webview); webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

Passing an Object to Fragment or DialogFragment upon Instantiation

痴心易碎 提交于 2021-02-17 21:36:32
问题 I'm trying to work out the correct way to pass in an Object to a Fragment or DialogFragment without breaking the 'empty constructor' rule. For example I have created a custom View and for each one I instantiate I want to associate a DiaglogFragment. This DialogFragment will be used to display controls with which the user can alter certain aspects of the custom View it is associated with. Because View is an Object I understand I cannot use setArguments(). I could implement a newInstance(View)

Too late to create Fragments?

僤鯓⒐⒋嵵緔 提交于 2021-02-11 17:21:30
问题 I am working on my first Android application. I just came to discover Fragments and I need them to create a ViewPager to create nice transitions between my activities, but I fear that it's too late to implement that. I have to put all my code ( MainActivity ) in my MainFragment? Or just some pieces I don't know what I have to keep in my MainActivity Here is my code public class MainActivity extends FragmentActivity { ObjectAnimator anim; ObjectAnimator anim2; private int display, result,

Android get view of fragment in activity [duplicate]

徘徊边缘 提交于 2021-02-11 14:34:08
问题 This question already has answers here : findViewById in Fragment (35 answers) Closed 8 months ago . I have an activity, let's call it A , and it launches a fragment like so: remoteFragment = new RemoteFragment(); getSupportFragmentManager() .beginTransaction() .replace(R.id.frameLayout_remote_activity, remoteFragment) .commit(); my remoteFragment looks something like this: public Button okBtn; public RemoteFragment() { // Required empty public constructor } @Override public View onCreateView

ActionBar Back button opens drawer instead of going back

拈花ヽ惹草 提交于 2021-02-11 12:20:51
问题 In my app I have problem like this. Note that I'm working with fragments and I have drawer too. That's the method in my MainActivity for drawer open/close. public void drawerInit() { toolbar = (Toolbar) findViewById(R.id.toolbar_actionbar); setSupportActionBar(toolbar); drawer = (DrawerLayout) findViewById(R.id.drawer); view = findViewById(R.id.mainView); toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) { @Override

PreferenceFragments not in the same FragmentManager?

萝らか妹 提交于 2021-02-11 07:49:07
问题 We have a PreferenceFragmentCompat , and with a tap on a preference, we want to switch from the current PreferenceFragmentCompat to a new PreferenceFragmentCompat . (To have certain settings on a new screen). However, regardless of what we have tried, we keep running into the following error: Fragment declared target fragment that does not belong to this FragmentManager MainActivity.kt class MainActivity : AppCompatActivity(), ActivityCompat.OnRequestPermissionsResultCallback,

PreferenceFragments not in the same FragmentManager?

风格不统一 提交于 2021-02-11 07:48:57
问题 We have a PreferenceFragmentCompat , and with a tap on a preference, we want to switch from the current PreferenceFragmentCompat to a new PreferenceFragmentCompat . (To have certain settings on a new screen). However, regardless of what we have tried, we keep running into the following error: Fragment declared target fragment that does not belong to this FragmentManager MainActivity.kt class MainActivity : AppCompatActivity(), ActivityCompat.OnRequestPermissionsResultCallback,

onContextMenuClosed not implemented in Fragment

别说谁变了你拦得住时间么 提交于 2021-02-10 09:46:10
问题 Strange, neither Fragment nor v4.Fragment implemented the "onContextMenuClosed". Other events are there, like onCreateContextMenu and onContextItemSelected. I need to clean up something when the context menu is dismissed, which can be activated by back button, tapping on the blank area on screen, or select one menu item in the context menu. How do I monitor the dismissal of a context menu in a fragment then? 回答1: The menu close event in a fragment will also trigger its parent activity's

Fragment onListItemClick

非 Y 不嫁゛ 提交于 2021-02-10 03:25:07
问题 My onListItemClick is never call when i click on item, the class is extends fragment not listfragment, because i have other view items in this fragment which is not list, so how to implement onlistitemclick in class extends fragment? class public class MainFiles extends Fragment { ArrayList<String> items; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.files, container, false); Button button_up = (Button

Fragment onListItemClick

你说的曾经没有我的故事 提交于 2021-02-10 03:24:12
问题 My onListItemClick is never call when i click on item, the class is extends fragment not listfragment, because i have other view items in this fragment which is not list, so how to implement onlistitemclick in class extends fragment? class public class MainFiles extends Fragment { ArrayList<String> items; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.files, container, false); Button button_up = (Button