Android Open Source - m-app View Log Activity






From Project

Back to project page m-app.

License

The source code is released under:

GNU General Public License

If you think the Android project m-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 *  Copyright 2013-2014 Sagar Gugwad <saagar.gugwad@gmail.com>
 */*from  w w w.j  av  a2  s.c om*/
 *  This file is part of mApp project.
 *
 *  mApp is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  any later version.
 *
 *  mApp is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with mApp.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.example.app;

import java.util.List;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.Toast;

public class ViewLogActivity extends ListActivity {

    static final String[] MOBILE_OS = 
            new String[] { "Android", "iOS", "WindowsMobile", "Blackberry"};
    private DataSource mDataSource = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mDataSource= new DataSource(getApplicationContext());
        mDataSource.open();

        List<CallLog> logs = mDataSource.getAllLogs();

        setListAdapter(new LogArrayAdapter(this, logs));

    }

    @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {

        //get selected items
        String selectedValue = (String) getListAdapter().getItem(position);
        Toast.makeText(this, selectedValue, Toast.LENGTH_SHORT).show();

    }

}




Java Source Code List

com.example.app.CallLog.java
com.example.app.DBHelper.java
com.example.app.DataSource.java
com.example.app.HomeActivity.java
com.example.app.LogArrayAdapter.java
com.example.app.ObserverService.java
com.example.app.Status.java
com.example.app.ViewLogActivity.java