여기 내 해결책은 다음과 같습니다.
첫 번째 활동이 내 XML 파일. 버튼을 클릭하면 버튼이있는 두 번째 활동으로 리디렉션됩니다.
활동 1 : 나는 완전한 소스 코드를 제공하고
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button nextBtn = (Button)findViewById(R.id.button1);
nextBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
startActivity(new Intent("com.ranjan.dibya.shadow.Next"));
}
});
}
}
활동을 2 :
public class Next extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.next);
}
}
활동 1 XML : 활동 2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f09473"
tools:context=".MainActivity" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"
android:text="Button" />
</RelativeLayout>
XML :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="This is clickable" />
</RelativeLayout>
,
내 매니페스트
<activity
android:name=".Next"
android:label="@string/app_name"
android:theme="@style/Theme.MyTranslucent" >
스타일 :
<style name="Theme.MyTranslucent" parent="android:style/Theme.Translucent">
<item name="android:backgroundDimEnabled">true</item>
<item name="android:backgroundDimAmount">0.5</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:background">@android:color/transparent</item>
</style>
이 나를 위해 작동합니다. 나는 너에게 똑같은 일이 있기를 바란다.
편집 :. 당신은 다음 링크는 중앙의 버튼을 사용하여 투명한 활동에 발생합니다 자신 :)으로이 문제를 파악
나는 심지어하여 GetWindow()를 setBackgroundDrawable 사용 (새 ColorDrawable (0)); 하지만 그것도 작동하지 않았다 –