package com.eni.android.data;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.widget.Toast;

public class RecepcionComparticionDatosEjemploActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
        final Intent intent = getIntent();
        final String action = intent.getAction();
        final String type = intent.getType();
        
        final String text = "text/plain";
        
        if (action.equals(Intent.ACTION_SEND)) {
        	if (text.equals(type)) {
        		String sharedUrl = intent.getStringExtra(Intent.EXTRA_TEXT);
        		if (sharedUrl != null)
        			Toast.makeText(this, sharedUrl, Toast.LENGTH_LONG).show();
        	}
        }
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.recepcion_comparticion_datos_ejemplo,
				menu);
		return true;
	}

}
