package com.eni.android.data;

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

public class Ch11_ReceptionPartageDonnnesExempleActivity extends Activity {

	@Override
    public 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();
        	}
        }
    }
}