title: how can I finish activity from view
body: <p>I have got an activity which has custom view.</p>
  
  <p>I have to add activity result:</p>
  
  <pre><code>    public class ActView extends Activity implements OnClickListener {
  &lt;...code...&gt;
  @Override
      protected void onCreate(Bundle savedInstanceState) {
      &lt;...code...&gt;
       layout = (LinearLayout) findViewById(R.id.chart_container);
          timelineview = new VDrawTimeLine(this,contentFull);
          timelineview.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
          timelineview.setBackgroundColor(0xffffffff);
          timelineview.setVisibility(View.VISIBLE);
  
          layout.addView(timelineview);
  
      &lt;...code...&gt;
      }
  }
  </code></pre>
  
  <p>View class:</p>
  
  <pre><code>public class VDrawTimeLine extends View implements OnTouchListener{
  &lt;...code...&gt;
  public VDrawTimeLine(Context context, ArrayList&lt;_MainData&gt; contentFull) {
          super(context);
          this.con = context;
          this.content = contentFull;
          &lt;...code...&gt;
      }
  }
  @Override
      public boolean onTouch(View v, MotionEvent event) {
          // TODO Auto-generated method stub
          finishFunction();//I need here finish event this activity result for ActView Activity.
          return true;
      }
  </code></pre>
  
  <p>finishFunction - what i have to write here to finish the ActView with the result for parent activity?</p>
  
  <p>I need somethin like this:</p>
  
  <pre><code>Intent intent = new Intent();
      intent.putExtra(dataname, value);
      setResult(RESULT_OK,intent);
      finish();
  </code></pre>