Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 30th, 2013, 02:40 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #2 (permalink)  
Old July 25th, 2013, 11:45 PM
Authorized User
Points: 51, Level: 1
Points: 51, Level: 1 Points: 51, Level: 1 Points: 51, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2013
Location: Netherlands
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.
Reply With Quote
  #3 (permalink)  
Old August 19th, 2013, 03:07 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #4 (permalink)  
Old September 14th, 2013, 07:36 PM
Registered User
Points: 26, Level: 1
Points: 26, Level: 1 Points: 26, Level: 1 Points: 26, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.