[android-developers] Re: How i can control the Screen On/Off Lock/Unlock in Donut( SDK 1.6)

2010-11-01 Thread krekar
I solved it.

Jason, if you want know about that, contact me by e-mail.
(swbon...@gamil.com)

On 10월30일, 오전2시53분, Jason Van Anden jason.van.an...@gmail.com wrote:
 I am facing the same issue.  Did you or does anyone else know the answer?

 J







 On Sun, Jan 3, 2010 at 9:43 PM, krekar swbon...@gmail.com wrote:
  hi, all( happy new year~! :D)

  I making an Alarm App.

  In my Alarm App, if user set the alarm, the alarm Dialog will be shown
  at the set alarm time.

  but if device(phone) was in lock and screen off, I can't see the alarm
  dialog.

  I need to write code to the alarm dialog will be shown automatically
  although the device(phone) is screen off(and locked).

  I see the source code about AlarmClock in Donut SDK.

  It is use the code like below:
  getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);

  but the FLAG_TURN_SCREEN_ON is only available in SDK 2.0 or later.

  I just only use Donut(SDK 1.6).

  How can i Screen on  unlock in Donut(SDK 1.6)?

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs 
  cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] EditText lose focus when appears keyboard in ListView

2010-04-28 Thread krekar
Hi, all :D

I make ListView that has some items that has one EditText and one
ImageButton.

When touch the EditText in ListView's Item, Keyboard was appeared but
EditText lose focus.

what can i do for resolve this problem?

ps: I can use ScrollView instead of ListView by addView in ScrollView.

 And in ScrollView, when i touch the EditText, keyboard was
appeared and EditText keep the focus.

 but I must optimize the list because the list may has many items.

 in ListView, I can optimize list in getView. But in ScrollVIew,
there was not way to optimaize list.

 so, I must use ListView.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] How i can control the Screen On/Off Lock/Unlock in Donut( SDK 1.6)

2010-01-03 Thread krekar
hi, all( happy new year~! :D)

I making an Alarm App.

In my Alarm App, if user set the alarm, the alarm Dialog will be shown
at the set alarm time.

but if device(phone) was in lock and screen off, I can't see the alarm
dialog.

I need to write code to the alarm dialog will be shown automatically
although the device(phone) is screen off(and locked).

I see the source code about AlarmClock in Donut SDK.

It is use the code like below:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);

but the FLAG_TURN_SCREEN_ON is only available in SDK 2.0 or later.

I just only use Donut(SDK 1.6).

How can i Screen on  unlock in Donut(SDK 1.6)?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Why Return null when using findViewById in Activity to find and handle CustomView?

2009-12-04 Thread krekar
hi, there...

I wrote CustomView Class, and load it in layout.

so i trid to find CustomView using findViewById()  in activiy to get
handle.

but findViewById() was return null.

I need your help .

Written Code is like below:

-

main.xml:

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

 TextView
android:layout_width=fill_parent
android:layout_height=10dp
android:text=@string/hello /
 com.test.MapCanvas
  android:id=@+id/map_canvas
  android:layout_width=fill_parent
  android:layout_height=100dp
 android:focusable=true
  android:clickable=true /
/LinearLayout

-

MapCanvas.java:

package com.test;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;

public class MapCanvas extends View {
 // ...
public MapCanvas(Context context) {
 super(context);
 initialize();
}

public MapCanvas(Context context, AttributeSet attrs) {
 super(context);
 initialize();
}

private void initialize() {
// ...
  }


 @Override
protected void onDraw(Canvas canvas) {
// ...
}
}

-

Test.java (Activity)

package com.test;

import android.app.Activity;
import android.os.Bundle;
import com.test.MapCanvas;

public class Test extends Activity {
/** Called when the activity is first created. */
 private MapCanvas mapCanvas;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mapCanvas = (MapCanvas)this.findViewById(R.id.map_canvas); //
*** null return.
}
}

-

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Why Broadcast receiver can't receive UMS_CONNECTED, UMS_DISCONNECTED msg dynamically in activity ?

2009-11-22 Thread krekar
hi.

I was make source to catch and process SD Card mount/unmount broadcast
received dynamically in activity.

but the USM_CONNECTED/DISCONNECTED broadcast msg is not catched
dynamically in activity like below:.

how the receiver can receive the UMS msg in activity?

below:

package com.test;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.provider.Settings;
import android.provider.Settings.*;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class IntentTest extends Activity {

public static BroadcastReceiver mReceiver1 = null;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

 // install an intent filter to receive SD card related events.
IntentFilter intentFilter1 = new IntentFilter
(Intent.ACTION_MEDIA_MOUNTED);
intentFilter1.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
intentFilter1.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
intentFilter1.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);
intentFilter1.addAction(Intent.ACTION_MEDIA_EJECT);
 // install an intent filter to receive UMS(USB) related events.
intentFilter1.addAction(Intent.ACTION_UMS_CONNECTED);
intentFilter1.addAction(Intent.ACTION_UMS_DISCONNECTED);
intentFilter1.addAction(USB_INTENT);
intentFilter1.addDataScheme(file);

mReceiver1 = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, context.toString(),
Toast.LENGTH_LONG).show();

String action = intent.getAction();
if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) {
Toast.makeText(context, SD Card mounted,
Toast.LENGTH_LONG).show();

} else if (action.equals
(Intent.ACTION_MEDIA_UNMOUNTED)) {
Toast.makeText(context, SD Card unmounted,
Toast.LENGTH_LONG).show();

} else if (action.equals
(Intent.ACTION_MEDIA_SCANNER_STARTED)) {
Toast.makeText(context, SD Card scanner started,
Toast.LENGTH_LONG).show();

} else if (action.equals
(Intent.ACTION_MEDIA_SCANNER_FINISHED)) {
Toast.makeText(context, SD Card scanner finished,
Toast.LENGTH_LONG).show();

} else if (action.equals(Intent.ACTION_MEDIA_EJECT)) {
Toast.makeText(context, SD Card eject,
Toast.LENGTH_LONG).show();

} else if(action.equals(Intent.ACTION_UMS_CONNECTED))
{
Toast.makeText(context, connected,
Toast.LENGTH_LONG).show();
} else if(action.equals
(Intent.ACTION_UMS_DISCONNECTED)) {
Toast.makeText(context, disconnected,
Toast.LENGTH_LONG).show();
}
// BONG_TEST }
}
};

registerReceiver(mReceiver1, intentFilter1);
 }
}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] how i can use Settings.Secure.ADB_ENABLED and Settings.Secure.USB_MASS_STORAGE_ENABLED?

2009-11-22 Thread krekar
Hi.

I wanna set the ADB_ENABLED and USB_MASS_STORAGE_ENABLED option
automatically  in my App.

so i add below statement in my App(Activity).

--
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.ADB_ENABLED, 0);

or

Settings.Secure.putInt(getContentResolver(),
Settings.Secure.ADB_ENABLED, 1);
--

and add below statement in my App(manifest).

--

/application
uses-permission android:name=android.permission.WRITE_SETTINGS /
uses-permission
android:name=android.permission.WRITE_SECURE_SETTINGS /

--

but some exception are occured in runtime like below.

--
Uncaught hander: thread main exiting due to uncaught exception.
java.lang.SecurityException: Permission denial: writing to secure
settings requires android.permission.WRITE_SECURE_SETTINGS
...
--

How i can use ADB_ENABLED and USB_MASS_STORAGE_ENABLED in my App?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en