วันอาทิตย์ที่ 23 มกราคม พ.ศ. 2554

PantipCafe - readOnly. Version 4.85

  • Fix Screen-Rotation Problem while content loading.
  • From Khun. Nantawat "ผมชอบนะ แต่น่าจะเอาหัวข้อฟุตบอลโลก2010 ออกจากห้องศุภฯ ได้แล้วนะครับ". Thanks for update.

Lock Screen Orientation in Android

REFERENCE : Lock Screen Orientation in Android


[Code sample – How to lock the orientation]
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.setRequestedOrientation(
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}


[Code sample – How to detect the current orientation]
switch (this.getResources().getConfiguration().orientation)
{
case Configuration.ORIENTATION_PORTRAIT:
// Do something here
break;
case Configuration.ORIENTATION_LANDSCAPE:
// Do something here
break;
case Configuration.ORIENTATION_SQUARE:
// Do something here
break;
default:
throw new Exception("Unexpected orientation enumeration returned");
break;
}

[Code sample – Locking rotation while performing an action]

// Sets screen rotation as fixed to current rotation setting
private void mLockScreenRotation()
{
// Stop the screen orientation changing during an event
switch (this.getResources().getConfiguration().orientation)
{
case Configuration.ORIENTATION_PORTRAIT:
this.setRequestedOrientation(
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
break;
case Configuration.ORIENTATION_LANDSCAPE:
this.setRequestedOrientation(
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
break;
}
}

[Code sample – How to re-enable screen rotation]
// allow screen rotations again
this.setRequestedOrientation(
ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);

วันอาทิตย์ที่ 9 มกราคม พ.ศ. 2554

Comment from @i-am_a

by i-am_a (January 9, 2011)

อยากให้ทำแอปเหมือนแบบนี้ลง ipad บ้างครับ ชอบแอปนี้มากเลย ขอบคุณครับ

ใจจริงก็อยากทำอยู่ครับ แต่ไม่มีเครื่อง Mac ครับผม โหลดแบบ OSX Hazard มาเล่นก็ไม่ค่อย Work เท่าไรครับผม

:)




วันพฤหัสบดีที่ 6 มกราคม พ.ศ. 2554

Gripes About Android’s WebView | Code by Coffee

Gripes About Android’s WebView | Code by Coffee

Bugs Loading Data

In addition to urls, WebViews can load html formatted (or plain text for that matter) strings by calling either loadData or loadDataWithBaseURL. Now, word of advice: unless your content is strictly alpha-numeric don’t call loadData, use loadDataWithBaseURL instead. The loadData method has a bug with the way it encodes certain characters including including ‘ % & and @. If you call loadData with one of these characters in the string you passed you will see an error page instead of your content. The loadDataWithBaseURL method does not have this problem. For more information about this issue see: http://code.google.com/p/android/issues/detail?id=1733 and also http://code.google.com/p/android/issues/detail?id=1593.



--


Make me waste 1HR. --'


How to query several columns with Hibernate? | Benjamin Winterberg

How to query several columns with Hibernate? | Benjamin Winterberg

Hi Lars,
nice post!!!

I was searching for an explanation of "new map(" hibernate query ability and your post came up.

It is a bit confusing though when you describe the part about the new map:"...each containing entries with aliases (the keys) to selected values". You basically explained a map here, but you'r not describing what will be the actual key and what the value in your example:
"select new map(c.name as name, c.order as order) from Customer c"

If I do the following:
List mapsList = session.createQuery("select new map(c.name as name, c.order as order) from Customer c").list();
would this be true:
List> orderMapsList = (List>) mapsList;
Will this way, every map contain one entry with key name and value the order? or will it contain multiple entries?! I am confused!

Kind Regards,
Despot

วันเสาร์ที่ 1 มกราคม พ.ศ. 2554

IPHONE 3GS หาย --'

IPHONE 3GS ได้หายไป
Imei : 01202-500997-2327, 012025009972327, 01202-50099-72327
SN : 88949YR73NP
PN : MC131TH/A

http://goo.gl/YknTc

ผู้ซื้อโปรดระวังครับ ถ้านำไปใช้บริการสามารถตามจับได้
ถ้าพบเจอแล้วต้องการคืน มีรางวัลให้ครับ

ขอบคุณครับ



เมื่อ Iphone หายแล้วต้องการจะ Recovery Contact หรือ Image, Video ต่างๆ ที่มี Backup อยู่ใน ITunes
ขอแนะนำ http://www.iphonebackupextractor.com/ ใช้งานดีมากครับ