1. Download our Official Android App: Forums for Android!

table and rss problem

Discussion in 'Android Lounge' started by VagosM, Feb 9, 2014.

  1. VagosM

    VagosM Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    2
    Joined:
    Feb 9, 2014

    Feb 9, 2014
    2
    0
    25
    Hello i am new in forum and in android developing aplications , i have an idea in java but is the first time i make a program in android.
    I have a big problem i find an rss code and put it in my aplication but is not work , i think is a problem with frame work and tabs.
    In aplication a ihave 6 tabs with different works in two of them i want to make an rss for two different sites.
    i belive the probleme is in frame works , the code is
    MainActivity i have the code for tabs
    [HIGH]public class MainActivity extends TabActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    TabHost tabHost = getTabHost();

    // Tab
    TabSpec Sspec = tabHost.newTabSpec("Shoopinp");
    Sspec.setIndicator("Shopping");
    Intent SIntent = new Intent(this, Shopping.class);
    Sspec.setContent(SIntent);
    // other tabs

    // Adding all TabSpec to TabHost
    tabHost.addTab(Sspec); // Adding tab[/HIGH]

    the shopping
    [HIGH]package com.example.project;



    import android.app.Activity;
    import android.os.Bundle;
    import android.support.v4.app.FragmentActivity;
    import android.support.v4.app.FragmentManager;
    import android.support.v4.app.FragmentTransaction;

    public class Shopping extends FragmentActivity {


    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.sho_layout);

    if (savedInstanceState == null) {
    addRssFragment();
    }
    }

    private void addRssFragment() {
    FragmentManager manager = getSupportFragmentManager();
    FragmentTransaction transaction = manager.beginTransaction();
    RssFragment fragment = new RssFragment();
    transaction.add(R.id.fragment_container, fragment);
    transaction.commit();
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean("fragment_added", true);
    }
    }[/HIGH]
    and the other is form a project i find in net and change for xml tag in my site tags from heare i see the code
    androidresearch.wordpress.com
    The main activity of this app i put the code in my shopping class and the other xml and java clas i put the same but change only the xml tangs and the site witch take it the rrs.
     

    Advertisement

Share This Page

Loading...