Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ScrollableTabsActivity2 extends AppCompatActivity {
- private Toolbar toolbar;
- private TabLayout tabLayout;
- private ViewPager viewPager;
- private Button logout_user;
- //private SQLiteHandler db;
- private SessionManager session;
- private TextView txtName;
- private TextView txtEmail;
- int s;
- String intentt="";
- File file;
- Uri filePath;
- ListView lv;
- ArrayList<Integer> hm=new ArrayList<>();
- String path=null;
- ArrayList<Planet> planetList=new ArrayList();
- private String myString = "azz";
- ArrayList<Integer> arraylistInteger;
- String value="";
- String numero_tavolo="";
- ArrayList<Integer> hm3=new ArrayList<>();
- ArrayList<Integer> hm_quantitàpizze=new ArrayList<>();
- TextView numero_tavolo_text_view;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_scrollable_tabs2);
- toolbar = (Toolbar) findViewById(R.id.toolbar);
- setSupportActionBar(toolbar);
- txtName = (TextView) findViewById(R.id.name);
- txtEmail = (TextView) findViewById(R.id.numero_telefonico);
- numero_tavolo_text_view=(TextView)findViewById(R.id.numero_tavolo);
- logout_user=(Button) findViewById(R.id.crisbio);
- logout_user.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- logoutUser();
- }
- });
- getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- viewPager = (ViewPager) findViewById(R.id.viewpagerr);
- setupViewPager(viewPager);
- tabLayout = (TabLayout) findViewById(R.id.tabss);
- tabLayout.setupWithViewPager(viewPager);
- Bundle extras = getIntent().getExtras();
- if (extras != null) {
- value = extras.getString("PATH FILE DA AGGIORNARE");
- numero_tavolo=extras.getString("NUMERO_TAVOLO");
- file = new File(value);
- System.out.println("FILE:" + file);
- FileInputStream is = null;
- try {
- is = new FileInputStream(file);
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder dBuilder = null;
- try {
- dBuilder = dbFactory.newDocumentBuilder();
- } catch (ParserConfigurationException e) {
- e.printStackTrace();
- }
- Document doc = null;
- try {
- doc = dBuilder.parse(is);
- } catch (SAXException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- Element element = doc.getDocumentElement();
- element.normalize();
- int a;
- int b;
- NodeList nList = doc.getElementsByTagName("checkboxes_pizza");
- hm.clear();
- hm_quantitàpizze.clear();
- for (int i = 0; i < nList.getLength(); i++) {
- Node node = nList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element2 = (Element) node;
- //tv1.setText(tv1.getText()+"\nName : " + getValue("name", element2)+"\n");
- String id = getValue("id", element2);
- a = Integer.parseInt(id);
- String idd = getValue("quantita", element2);
- b = Integer.parseInt(idd);
- System.out.println("XMLLLLLLLLLL:" + b);
- hm.add(a);
- hm_quantitàpizze.add(b);
- System.out.println("AZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ:" + hm_quantitàpizze);
- System.out.println("LAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:" + hm);
- }
- }
- Bundle bundle = new Bundle();
- bundle.putIntegerArrayList("oki", hm);
- bundle.putIntegerArrayList("okiquantitapizze", hm_quantitàpizze);
- MyListFragment2 myFragment = new MyListFragment2();
- myFragment.setArguments(bundle);
- FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
- transaction.replace(R.id.cristo, myFragment);
- transaction.commit();
- /* MyListFragment myFragment = MyListFragment.newInstance(hm,hm_quantitàpizze);
- FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
- //transaction.replace(R.id.a, myFragment);
- //transaction.replace(R.id.porcozio, myFragment);
- transaction.replace(android.R.id.content, myFragment);
- transaction.commit();
- */
- }
- numero_tavolo_text_view.setText(numero_tavolo);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement