Android Open Source - dNote D M Save From






From Project

Back to project page dNote.

License

The source code is released under:

GNU General Public License

If you think the Android project dNote 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

package com.digutsoft.note;
//from   www  . j av a  2  s. c  om
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

import com.digutsoft.note.classes.DMMemoTools;


public class DMSaveFrom extends ActionBarActivity {

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

        getSupportActionBar().setTitle(R.string.save_from);

        final ListView lvCategoryList = (ListView) findViewById(R.id.lvCategoryList);
        ArrayAdapter<String> aaCategoryList = new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1,
                DMMemoTools.getCategoryList(this));
        lvCategoryList.setAdapter(aaCategoryList);
        lvCategoryList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                switch (DMMemoTools.saveMemo(DMSaveFrom.this, lvCategoryList.getItemAtPosition(i).toString(), getIntent().getStringExtra(Intent.EXTRA_TEXT))) {
                    case 0:
                        Toast.makeText(DMSaveFrom.this, R.string.sf_save_success, Toast.LENGTH_SHORT).show();
                        Intent intOpenMemoView = new Intent(DMSaveFrom.this, DMMain.class);
                        intOpenMemoView.putExtra("mvCategoryName", lvCategoryList.getItemAtPosition(i).toString());
                        startActivity(intOpenMemoView);
                        finish();
                        break;
                    case 1:
                        Toast.makeText(DMSaveFrom.this, R.string.mv_save_fail, Toast.LENGTH_LONG).show();
                        break;
                    case 2:
                        Toast.makeText(DMSaveFrom.this, R.string.mv_save_fail_empty, Toast.LENGTH_LONG).show();
                        break;
                }

            }
        });
    }
}




Java Source Code List

android.support.v4.preference.PreferenceFragment.java
android.support.v4.preference.PreferenceManagerCompat.java
android.support.v4.preferencefragment.BuildConfig.java
android.support.v4.preferencefragment.BuildConfig.java
com.digutsoft.note.DMCategoryManager.java
com.digutsoft.note.DMMain.java
com.digutsoft.note.DMMemoView.java
com.digutsoft.note.DMNewNote.java
com.digutsoft.note.DMSaveFromWear.java
com.digutsoft.note.DMSaveFrom.java
com.digutsoft.note.DMSettingsFragment.java
com.digutsoft.note.DMSettings.java
com.digutsoft.note.DMSplash.java
com.digutsoft.note.DMWearVoiceAction.java
com.digutsoft.note.DrawerMenuList.java
com.digutsoft.note.NavigationDrawerFragment.java
com.digutsoft.note.classes.DMDatabaseHelper.java
com.digutsoft.note.classes.DMMemoList.java
com.digutsoft.note.classes.DMMemoTools.java