Wrox Programmer Forums
|
BOOK: Professional Android 4 Application Development
This is the forum to discuss the Wrox book Professional Android 4 Application Development Reto Meier; ISBN: 978-1-1181-0227-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 4 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 30th, 2013, 02:40 AM
Registered User
 
Join Date: Apr 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Another To Do List Problem

This question is about lower level APIs using the support class for fragments.

I'm trying to convert the To Do List part 2 with fragments to be run-able on lower android API devices. I am programming on my android 2.3.6 phone and I cannot use regular fragments, I have to use the support library's FragmentActivity instead of fragment. There are a few references to higher level fragment references like fragment manager and list fragment. Can someone help me convert the code and confirm that it works? I noticed that when I change the NewItemFragment activity to extend FragmentActivity instead of fragment, the

public void onAttach(Activity activity){

super.onAttach(activity);

Bleeds. I have already looked up a few examples, and stared at the android.development documents, but have not been able to produce a working fragment program. Thanks in advance. Let me know if I need to be more specific.
 
Old July 25th, 2013, 11:45 PM
Authorized User
 
Join Date: Apr 2013
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post
Default

Post the onCreate method and other relevant lines of codes e.g. class instance variables and methods that are invoked in the onCreate method.

What do you mean by bleed? Do you mean that there is a 'memory leak'/ an object that is not recycled by garbage collection?

What prevents the successful execution of the program, be more specific in your explanation. It would also help if you posted the logcat.
 
Old August 19th, 2013, 03:07 PM
Registered User
 
Join Date: Jun 2013
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When I develop for the older levels, make sure you use the documentation and the many samples for the old SDKs. I'll bet in the SDK level 10 has good samples of the "then new" now obsolete fragment code. We all have to learn to time travel with the frequency SDKs change.
 
Old September 14th, 2013, 07:36 PM
Registered User
 
Join Date: Sep 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There are several things you have to do here:

1. Make TodoListActivity extend FragmentActivity.
2. Use this to get the FragmentManager: FragmentManager fm = getSupportFragmentManager();

Code:
public class ToDoListActivity extends FragmentActivity implements NewItemFragment.OnNewItemAddedListener {

    FragmentManager fm = getSupportFragmentManager();
I have no idea why they have you create the project with backward support but then don't use the needed support library stuff.





Similar Threads
Thread Thread Starter Forum Replies Last Post
To Do List Example Problem marfl99 BOOK: Professional Android 4 Application Development 4 April 16th, 2013 03:37 PM
Problem with Try it Out List Controls phage BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 6 September 15th, 2008 02:15 PM
List Box Problem aliirfan84 ASP.NET 2.0 Professional 0 May 24th, 2007 06:40 AM
Problem with Drop down list praveen_haridas ASP.NET 1.0 and 1.1 Basics 3 January 26th, 2006 05:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.