Clover Coverage Report - SaveApp Coverage Report
Coverage timestamp: mar dic 23 2014 15:53:11 EST
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
29   64   8   5,8
6   56   0,28   5
5     1,6  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  NoteActivity       Line # 12 29 8 92,5% 0.925
 
No Tests
 
1    package com.loopback.androidapps.saveapp;
2   
3    import android.app.Activity;
4    import android.content.Intent;
5    import android.os.Bundle;
6    import android.text.InputType;
7    import android.util.Log;
8    import android.view.View;
9    import android.widget.Button;
10    import android.widget.EditText;
11   
 
12    public class NoteActivity extends Activity implements View.OnClickListener {
13   
14    private EditText edtNote;
15    private Button btnSaveNote, btnDiscardNote;
16    private String note;
17   
 
18  5 toggle public void onCreate(Bundle savedInstanceState) {
19  5 super.onCreate(savedInstanceState);
20  5 setContentView(R.layout.note);
21  5 Bundle bundle = this.getIntent().getExtras();
22  5 note = bundle.getString("Note");
23  5 edtNote = (EditText) findViewById(R.id.edtNote);
24  5 btnSaveNote = (Button) findViewById(R.id.btnSaveNote);
25  5 btnDiscardNote = (Button) findViewById(R.id.btnDiscardNote);
26  5 btnSaveNote.setOnClickListener(this);
27  5 btnDiscardNote.setOnClickListener(this);
28  5 edtNote.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS);
29    }
30   
 
31  5 toggle public void onResume() {
32  5 super.onResume();
33  5 if (note.equals(""))
34  3 note = edtNote.getText().toString();
35    else
36  2 edtNote.setText(note);
37    }
38   
 
39  0 toggle public void onBackPressed() {
40  0 finishActivity();
41    }
42   
 
43  5 toggle public void onClick(View v) {
44  5 Log.i("NTA", "Click...");
45  5 if (v == btnSaveNote) {
46  3 note = edtNote.getText().toString();
47  3 finishActivity();
48  2 } else if (v == btnDiscardNote) {
49  2 finishActivity();
50    }
51    }
52   
 
53  5 toggle private void finishActivity() {
54  5 Log.i("NTA", "Finishing...");
55  5 int RESULT = RESULT_FIRST_USER;
56  5 Bundle bundle = new Bundle();
57  5 bundle.putString("Note", note);
58  5 Intent intent = new Intent(this.getApplicationContext(),
59    OutlayEditActivity.class);
60  5 intent.putExtras(bundle);
61  5 setResult(RESULT, intent);
62  5 finish();
63    }
64    }