Ejemplo n.º 1
0
 private void sendExceptionMsg(int what, Exception e) {
   e.printStackTrace();
   Message msg = Message.obtain();
   msg.obj = e;
   msg.what = what;
   queryHandler.sendMessage(msg);
 }
Ejemplo n.º 2
0
 @Override
 public void onClick(View v) {
   Message msg = new Message();
   msg.what = clickIndex;
   msg.arg1 = position;
   Bundle b = new Bundle();
   b.putSerializable(BUNDLE_KEY_LIDATA, list.get(position));
   msg.setData(b);
   mHandle.sendMessage(msg);
 }
Ejemplo n.º 3
0
 @Override
 public boolean queueIdle() {
   // Log.i(logTag, "in idle handler");
   if (nativeRender()) {
     // Log.i(logTag, "will re-run");
     Message msg = Message.obtain();
     handler.sendMessageAtFrontOfQueue(
         msg); // force idle handler to re-run in case of no pending msgs
     return true;
   } else {
     // Log.i(logTag, "won't re-run");
     idleHandlerActive = false;
     return false;
   }
 }
Ejemplo n.º 4
0
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   View v = convertView;
   if (v == null) {
     LayoutInflater vi =
         (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
     v = vi.inflate(R.layout.row, null);
   }
   Message m = items.get(position);
   // if (m != null) {
   m.createColorFromString(m.from);
   TextView tt = (TextView) v.findViewById(R.id.username);
   TextView bt = (TextView) v.findViewById(R.id.message);
   if (isMonospaced) {
     tt.setTypeface(Typeface.MONOSPACE);
     bt.setTypeface(Typeface.MONOSPACE);
   }
   tt.setText(m.getFrom());
   tt.setTextColor(m.color);
   bt.setText(m.getMessage());
   // }
   return v;
 }
Ejemplo n.º 5
0
 // Send a message from the SDLMain thread
 boolean sendCommand(int command, Object data) {
   Message msg = commandHandler.obtainMessage();
   msg.arg1 = command;
   msg.obj = data;
   return commandHandler.sendMessage(msg);
 }
 public void doCallback(com.moji.mjweather.common.WeatherUpdater.Result result) {
   Message message = new Message();
   message.what = 0;
   message.obj = result;
   MainHandler.sendMessage(message);
 }