[android-developers] Digest for android-developers@googlegroups.com - 10 Messages in 5 Topics

Group: http://groups.google.com/group/android-developers/topics

    "Ralph Bergmann | the4thFloor.eu" <ralph@the4thfloor.eu> Aug 31 01:44AM +0200  

    I am trying to add nested child Fragments into a parent Fragment.
     
    All works fine but....
     
    At first my code:
     
    public class FragmentDatasheetWithHeader extends Fragment {
     
     
    private long mRowId;
    private String mSid;
     
     
    @Override
    public View onCreateView(final LayoutInflater inflater, final
    ViewGroup container, final Bundle savedInstanceState) {
     
    final ScrollView scrollView = new ScrollView(getActivity());
    final LinearLayout linearLayout = new LinearLayout(getActivity());
    linearLayout.setId(4711);
    linearLayout.setOrientation(LinearLayout.VERTICAL);
     
    scrollView.addView(linearLayout);
     
    createUI();
     
    return scrollView;
    }
     
    private void createUI() {
     
    final FragmentProductDetailHeader fragmentHeader =
    FragmentProductDetailHeader.newInstance(this.mRowId,
    FragmentProductDetailHeader.HEADERTYPE_SMALL);
    final FragmentDatasheet fragmentDatasheet =
    FragmentDatasheet.newInstance(this.mRowId, this.mSid);
     
    final FragmentManager fragmentManager = getChildFragmentManager();
    fragmentManager.beginTransaction().add(4711, fragmentHeader,
    "fragmentHeader").commit();
    fragmentManager.beginTransaction().add(4711, fragmentDatasheet,
    "fragmentDatasheet").commit();
    }
    }
     
    Now my problem:
     
    In the Developer options I activated "Don't keep activities (Destroy
    every activity as soon the user leaves it)"
     
    When the activity with the FragmentDatasheetWithHeader is open and the
    app goes into background and comes back to foreground the nested
    Fragments are doubled. But it only appears if the container for the
    nested Fragments is a LinearLayout. If the container is a FrameLayout
    the nested Fragments are not doubled.
     
    What's going wrong?
     
     
    Ralph

     

    TreKing <trekingapp@gmail.com> Aug 30 07:02PM -0500  

    On Fri, Aug 30, 2013 at 6:44 PM, Ralph Bergmann | the4thFloor.eu <
    > nested Fragments is a LinearLayout. If the container is a FrameLayout
    > the nested Fragments are not doubled.
     
    > What's going wrong?
     
    1 - Debug your app and gather more information.
    2 - Use the logging utility at your disposal to spew out information about
    what your app is doing.
    3 - Use the info from (1) and (2) above to determine whether your app is,
    in fact, is going through the creation of this fragment twice.
     
    The frame layout may have two items in it, you just may not be able to tell
    that there are two since they would overlap. In a LinearLayout, it would be
    obvious.
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    "Ralph Bergmann | the4thFloor.eu" <ralph@the4thfloor.eu> Aug 31 02:51AM +0200  

    Am 31.08.13 02:02, schrieb TreKing:
    > 1 - Debug your app and gather more information.
     
    I debugged it. The createUI() method is called once.
     
     
     
    Ralph

     

    Ash <anangia@gmail.com> Aug 30 04:06AM -0700  

    Hi All,
     
    I have a mobile phone from Runbo (
    http://www.runboruggedphones.com/shop/buy-runbo-x5-ip67-rugged-waterproof-smartphone.html
    ).
     
    It has a 3 additional buttons which I have not seen on normal Android
    phones. These are PTT, SOS and ET.
     
    I was able to detect the SOS and ET button using the following functions:
    public void onKeyUp(...)
    and
    public void onKeyDown(...)
     
    The keycode values for SOS and ET were very high in the range. ET was set
    to 300 and SOS was 301. But that does not matter as long as I can detect
    them.
     
    However I am not able to detect the PTT button press.
     
    Has anyone got any ideas on how to detect when the PTT button is pressed?
     
    Any advice or help will be much appreciated.
     
    Thanks
    Ash

     

    Jadranko Bodiroga <jadrankobodiroga1985@gmail.com> Aug 30 03:00PM +0200  

    something like this maybe: if (event.getKeyCode() == KeyEvent.KEYCODE_POWER
    ) {}
     
     
     

     

    Jadranko Bodiroga <jadrankobodiroga1985@gmail.com> Aug 30 03:01PM +0200  

    add permission : <uses-permission android:name=
    "android.permission.PREVENT_POWER_KEY" />
     
     
    On Fri, Aug 30, 2013 at 3:00 PM, Jadranko Bodiroga <

     

    Ash <anangia@gmail.com> Aug 30 02:53PM -0700  

    The code you have given is to detect the Power button. I want to detect the
    PTT (push-to-talk) button.
     
    On Friday, 30 August 2013 23:01:01 UTC+10, baturanija1 wrote:

     

    Emanuel Moecklin <1gravityllc@gmail.com> Aug 30 02:51PM -0700  

    See my answer here with a complete example:
    http://stackoverflow.com/a/18541955/534471
     
    On Thursday, March 24, 2011 5:11:48 AM UTC-4, asher wrote:

     

    Jadranko Bodiroga <jadrankobodiroga1985@gmail.com> Aug 30 03:06PM +0200  

    maybe try add something like this : super.setRequestedOrientation(
    ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) ...then you force it to show in
    portal/Landscape...
     
     
    On Fri, Aug 30, 2013 at 4:58 AM, Sadhna Upadhyay

     

    ankit the OPIUM <ankitgoyal1009@gmail.com> Aug 30 04:40AM -0700  

    My customers are complaining that my app is not working properly in New
    Nexus 7(2013). I want to test it in that but device is not available for
    sale in India. So when I tried to create emulator for the given
    configuration it is not booting at all. I have tried on Windows XP and 7
    both with latest SDK 20.0.5
    I have created new device with following configuration.
    1200*1920
    xhdpi (also tried with hdpi and xxhdpi also)
     
    Am I missing something?

     

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment