Sunday, November 24, 2013

Why can't I take screenshots in Android Emulator after installing Genymotion? [android help]


Why can't I take screenshots in Android Emulator after installing Genymotion?


Why can't I take screenshots in Android Emulator after installing Genymotion? - Stack Overflow







Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
















I've installed Genyomtion android emulator. Then I realized I can't take screenshots in Eclipse DDMS view. After that, I tried to take a screenshot with standard android emulator that comes with the SDK. It didn't work. Eclipse shows me a black image instead of screenshot. It worked before I installed Genymotion! It's suspicious that Genymotion hacked my ADB, because screenshot taking is part of PAID version of GenyMotion!


Has anyone experienced the same problem? How can I get Eclipse taking screenshots again without reinstalling it?


Thanks in advance!


























It's a known bug on 4.3 images, they are working on a fix. On a 4.2.2 image it's working for me, you can try to create a 4.2.2 device to take screenshot in the meantime.


Source: On twitter @genymotion responded to @Littledot1230 on this question :)























I have just used Genymotion and Eclipse DDMS today to take a screenshot for an app store submission.


So it works on at least these versions on my Win8 Pro machine:


  • Genymotion v1.1.0

  • Android 4.2.2 10" image

  • Eclipse ADT v22.0.1

Edit: so 4.2.2 is why mine worked - thanks Bonrry























default






Read more

stackoverflow.comm



Screen becomes blank for long time while loading SherlockFragmentActivity with fragments [android help]


Screen becomes blank for long time while loading SherlockFragmentActivity with fragments



I am implementing jeremyfeinstein sliding menu library. for this I have an activity which extends SherlockFragmentActivity. for this activity I have two fragments one is for left menu and another is for Main screen. Everything is working fine and smooth but still I have a problem that is when my Sliding menu activity starts, it becomes blank for 8-10 seconds. after 8-10 seconds my main screen fragment becomes visible. this is my base class:



public class SlidingFragmentActivity extends SherlockFragmentActivity implements SlidingActivityBase {

private SlidingActivityHelper mHelper;

/* (non-Javadoc)
* @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle)
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHelper = new SlidingActivityHelper(this);
mHelper.onCreate(savedInstanceState);
}

/* (non-Javadoc)
* @see android.app.Activity#onPostCreate(android.os.Bundle)
*/
@Override
public void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
mHelper.onPostCreate(savedInstanceState);
}

/* (non-Javadoc)
* @see android.app.Activity#findViewById(int)
*/
@Override
public View findViewById(int id) {
View v = super.findViewById(id);
if (v != null)
return v;
return mHelper.findViewById(id);
}

/* (non-Javadoc)
* @see android.support.v4.app.FragmentActivity#onSaveInstanceState(android.os.Bundle)
*/
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
mHelper.onSaveInstanceState(outState);
}

/* (non-Javadoc)
* @see android.app.Activity#setContentView(int)
*/
@Override
public void setContentView(int id) {
setContentView(getLayoutInflater().inflate(id, null));
}

/* (non-Javadoc)
* @see android.app.Activity#setContentView(android.view.View)
*/
@Override
public void setContentView(View v) {
setContentView(v, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
}

/* (non-Javadoc)
* @see android.app.Activity#setContentView(android.view.View, android.view.ViewGroup.LayoutParams)
*/
@Override
public void setContentView(View v, LayoutParams params) {
super.setContentView(v, params);
mHelper.registerAboveContentView(v, params);
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(int)
*/
public void setBehindContentView(int id) {
setBehindContentView(getLayoutInflater().inflate(id, null));
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(android.view.View)
*/
public void setBehindContentView(View v) {
setBehindContentView(v, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(android.view.View, android.view.ViewGroup.LayoutParams)
*/
public void setBehindContentView(View v, LayoutParams params) {
mHelper.setBehindContentView(v, params);
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#getSlidingMenu()
*/
public SlidingMenu getSlidingMenu() {
return mHelper.getSlidingMenu();
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#toggle()
*/
public void toggle() {
mHelper.toggle();
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#showAbove()
*/
public void showContent() {
mHelper.showContent();
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#showBehind()
*/
public void showMenu() {
mHelper.showMenu();
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#showSecondaryMenu()
*/
public void showSecondaryMenu() {
mHelper.showSecondaryMenu();
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setSlidingActionBarEnabled(boolean)
*/
public void setSlidingActionBarEnabled(boolean b) {
mHelper.setSlidingActionBarEnabled(b);
}

/* (non-Javadoc)
* @see android.app.Activity#onKeyUp(int, android.view.KeyEvent)
*/
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
boolean b = mHelper.onKeyUp(keyCode, event);
if (b) return b;
return super.onKeyUp(keyCode, event);
}

}


Here is my Main activity which loads fragments



public class SliderMenuMainActivity extends SlidingFragmentActivity
{
private Fragment mContent;
ImageButton btnToggle,refresh;
String ns = Context.NOTIFICATION_SERVICE;
public static int msg_count = 0;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(obj==null)
obj=new Progress_Dialog(this);
obj.setCancelable(false);
obj.onPreExecute("MAIN Screen");
if (savedInstanceState != null)
mContent = getSupportFragmentManager().getFragment(savedInstanceState, "mContent");
prepareScreen();
}
private void prepareScreen()
{
setContentView(R.layout.activity_slider_menu_main);

ActionBar ab = getSherlock().getActionBar();
LayoutInflater li = LayoutInflater.from(this);
View customView = li.inflate(R.layout.custom_titlebar, null);
customView.setLayoutParams(new ActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT ,ActionBar.LayoutParams.MATCH_PARENT));
ab.setCustomView(customView);
ab.setDisplayShowHomeEnabled(false);
ab.setDisplayShowCustomEnabled(true);
if (findViewById(R.id.menu_frame) == null)
{
setBehindContentView(R.layout.menu_frame);
getSlidingMenu().setSlidingEnabled(true);
getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
// show home as up so we can toggle
//getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
else
{
// add a dummy view
View v = new View(this);
setBehindContentView(v);
getSlidingMenu().setSlidingEnabled(false);
getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
}


if (mContent == null)
mContent = new MainScreenFragment();

getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, mContent).commit();

// set the Behind View Fragment
getSupportFragmentManager().beginTransaction().replace(R.id.menu_frame, new MenuFragment()).commit();

// customize the SlidingMenu
SlidingMenu sm = getSlidingMenu();
sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
sm.setShadowWidthRes(R.dimen.shadow_width);
sm.setShadowDrawable(R.drawable.shadow);
sm.setBehindScrollScale(0.25f);
sm.setFadeDegree(0.25f);
setSlidingActionBarEnabled(false);

}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
toggle();
}
return super.onOptionsItemSelected(item);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
getSupportFragmentManager().putFragment(outState, "mContent", mContent);
}
public void switchContent(final Fragment fragment) {
mContent = fragment;
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, fragment)
.commit();
Handler h = new Handler();
h.postDelayed(new Runnable() {
public void run() {
getSlidingMenu().showContent();
}
}, 50);
}

@Override
public void onResume()
{
super.onResume();
if(obj!=null)
obj.onPostExecute();
}
}


So please help me with this and show me a way to overcome this problem. thanks in advance.



Read more

stackoverflow.comm



Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...