Join FlipAndroid.COM Telegram Group:

Error: ViewPostImeInputStage ACTION_DOWN

No puedo entender por qué mi método onClick para mis botones no funciona. Cada vez que hago clic en el botón, mi logcat dice ViewPostImeInputStage Action_Down.

¡Agradezco cualquier ayuda!

public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); BluetoothConnect fragment = new BluetoothConnect(); transaction.add(, fragment); transaction.commit(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == { return true; } return super.onOptionsItemSelected(item); } 

Y este es mi fragmento.

public class BluetoothConnect extends Fragment {

 //For debugging purposes private static final String TAG = "BluetoothConnect"; // Intent request codes private static final int REQUEST_CONNECT_DEVICE_SECURE = 1; private static final int REQUEST_CONNECT_DEVICE_INSECURE = 2; private static final int REQUEST_ENABLE_BT = 3; //Main buttons private Button shareButton; private Button listenButton; private TextView test; /** * Name of the connected device */ private String mConnectedDeviceName = null; /** * Local Bluetooth adapter */ private BluetoothAdapter mBluetoothAdapter = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); //Get local Bluetooth adapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); //If the adapter is null, then Bluetooth is not supported if (mBluetoothAdapter == null) { FragmentActivity activity = getActivity(); Toast.makeText(activity, "Bluetooth is not available", Toast.LENGTH_LONG).show(); activity.finish(); } } @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.activity_main, container, false); } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { listenButton = (Button) view.findViewById(; shareButton = (Button) view.findViewById(; test = (TextView) view.findViewById(; } @Override public void onStart() { super.onStart(); //If BT is not on, request that it be enabled if (!mBluetoothAdapter.isEnabled()) { Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(enableIntent, REQUEST_ENABLE_BT); } else { setupButtons(); } } @Override public void onDestroy() { super.onDestroy(); //Figure out what to do if we need to destroy } @Override public void onResume() { super.onResume(); //figure out what to do if person pauses out of app } public void setupButtons() { Log.d(TAG, "setupButtons()"); //Initialize the music buttons listenButton.setOnClickListener(new ButtonOnClickListener("listen")); Log.d(TAG, "finished listenButton"); shareButton.setOnClickListener(new ButtonOnClickListener("share")); } private class ButtonOnClickListener implements View.OnClickListener { String type; public ButtonOnClickListener(String button) { Log.d(TAG, this.type); this.type = button; } public void onClick(View view) { if (this.type == "listen") { listenMusic(); } else { shareMusic(); } } } private void ensureDiscoverable() { if (mBluetoothAdapter.getScanMode() != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) { Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300); startActivity(discoverableIntent); } } private void listenMusic() { Log.d(TAG, "OMG ITS WORKING"); } private void shareMusic() { Log.d(TAG, "OMG ITS WORKING"); } 


¡Muchas gracias!

One Solution collect form web for “Error: ViewPostImeInputStage ACTION_DOWN”

echa un vistazo aquí

Envuelva su diseño sobre el que ya tiene

FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.