可以告诉我们如何将两个媒体文件合并/合并成一个?
我找到了一个主题,audioInputStream但现在它不支持android,以及java的所有代码.
在StackOverflow上,我在这里找到了这个链接,但在那里我找不到解决方案 - 这些链接只在流音频上.谁能告诉我?
PS和为什么我不能开始赏金?:(
我讨厌这家公司。所有这些设备都有很多错误。好的问题:我试图解决愚蠢的问题(据我所知存在超过 5 年)它从相机拍摄的照片 - 旋转了 90 度。我有两个设备:
Nexus 5p and Samsung j2
Nexus - work perfect. Everything fine.
Samsung - photo rotated
Run Code Online (Sandbox Code Playgroud)
例如 :
Photo size - nexus : Portrate : width 1000, height 1900. Landscape :
width 1900 , height 1000
Run Code Online (Sandbox Code Playgroud)
让我们看看三星设备:
Photo size - Portrate: width 1900(?????) height - 1000(????)
rotate to landscape : width 1900 height 1000
Run Code Online (Sandbox Code Playgroud)
经过一些测试:如果在三星设备上以横向模式拍摄照片 - 一切都好。照片未旋转
如果在 PORTRATE 中制作照片 - 照片旋转 90 度。(但是照片的大小与风景一样(如何可能)?
有人知道如何修复这个愚蠢的错误吗?也许有人可以告诉我如何检测相机的方向?我使用 IntentActivity 拍摄照片:
String _path = Environment.getExternalStorageDirectory()
+ File.separator + …Run Code Online (Sandbox Code Playgroud) 我有一些代码,我在位图(画布)上绘制我的文字
canvas.drawTextOnPath(Text, textPath[count], gipa, -10, text);
Run Code Online (Sandbox Code Playgroud)
请告诉我,可以在路径(textPath)中使用背景颜色绘制此文本吗?
它只是绘制文本的全部功能
public void drawText(float x,float y ,String Text,Canvas canvas,Paint paint1 ,int count )
{
float xren =text.measureText(Text.trim());
canvas.drawTextOnPath(Text, textPath[count], gipa, -10, text);
}
Run Code Online (Sandbox Code Playgroud)
使用此功能我在画布上绘制文字.那么如何修改这个函数来用背景绘制这个文本?
我有一个数组例如:
String [][] test = {{"a","1"},
{"b","1"},
{"c","1"}};
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我如何从数组中删除元素.例如,我想删除项"b",以便数组看起来像:
{{"a","1"},
{"c","1"}}
Run Code Online (Sandbox Code Playgroud)
我找不到办法.到目前为止我在这里发现的不适合我:(
我试图从录音机录制声音,但在 android 6+ 上我得到权限错误。我添加了请求权限的代码(有 3 个权限请求) 2 工作但 CAPTURE_AUDIO_OUTPUT 显示错误。它只是不要求我授予许可。在日志中它只是“未授予”有人知道什么问题吗?
public static boolean PermissionCheck(Activity context, String permission, int code) {
boolean state = false;
int permissionCheck = ContextCompat.checkSelfPermission(context,
permission);
if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(context, new String[]{permission}, code); // define this constant yourself
} else {
// you have the permission
return true;
}
return state;
}
case CAPTURE_AUDIO_OUTPUT_CONSTANT: {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Logger.e("CAPTURE PERMISSION GRANTED");
INIT();
} else {
Logger.e("CAPTURE PERMISSION NOT GRANTED"); …Run Code Online (Sandbox Code Playgroud) 家伙.我有这个代码(asyncTask)
我的animation()函数:
public void animation()
{
int currentRotation = 0;
anim = new RotateAnimation(currentRotation, (360*4),
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
currentRotation = (currentRotation + 45) % 360;
anim.setInterpolator(new LinearInterpolator());
anim.setDuration(4000);// i want rotating without this <------------------
anim.setFillEnabled(true);
anim.setFillAfter(true);
refresh.startAnimation(anim);
}
Run Code Online (Sandbox Code Playgroud)
谁能告诉我没有anim.setDuration???? 可以做到这一点 只是开始..当我按下按钮(例如)动画停止.请帮我.问候,彼得.
最终代码:
public void animation()
{
int currentRotation = 0;
anim = new RotateAnimation(currentRotation, (360*4),
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
currentRotation = (currentRotation + 45) % 360;
anim.setInterpolator(new LinearInterpolator());
anim.setDuration(4000);
// anim.setRepeatMode(Animation.INFINITE);
anim.setRepeatCount(Animation.INFINITE);
anim.setFillEnabled(true);
anim.setFillAfter(true);
refresh.startAnimation(anim);
}
Run Code Online (Sandbox Code Playgroud)
和refresh.clearAnimation();停止动画的某个地方 …
我找到了一个代码但有时会出错:
StringBuilder strHeaders = new StringBuilder();
char c;
while ((c = (char)stream.read()) != -1) {
strHeaders.append(c);
if (strHeaders.length() > 5 && (strHeaders.substring((strHeaders.length() - 4), strHeaders.length()).equals("\r\n\r\n"))) {
// end of headers
break;
}
}
Run Code Online (Sandbox Code Playgroud)
logcat的
java.lang.OutOfMemoryError
at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:95)
at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:140)
at java.lang.StringBuilder.append(StringBuilder.java:125)
at myApp.activity.com.getFromPLS.retreiveMetadata(getFromPLS.java:98)
at myApp.activity.com.getFromPLS.refreshMeta(getFromPLS.java:76)
at myApp.activity.com.myApp$1.run(myApp.java:371)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)
这条线上的错误
strHeaders.append(c);
Run Code Online (Sandbox Code Playgroud)
请任何人可以帮我解决这个问题?
我正在尝试AlertDialog使用图像文本和按钮创建自定义.当我显示它时,我得到一个看起来很可怕的白色边框.

我该如何摆脱那个白色边框?
这是我的自定义对话框:
public LinearLayout customeLL;
public void alertD()
{
AlertDialog ad;
AlertDialog.Builder builder;
Context mContext = getApplicationContext();
TextView a = new TextView(getApplicationContext());
a.setText("Test dialog");
ImageView img = new ImageView(getApplicationContext());
img.setBackgroundResource(R.drawable.bottombar_bg);
LinearLayout customeLL = new LinearLayout(getApplicationContext());
customeLL.setOrientation(LinearLayout.VERTICAL);
customeLL.addView(img,curWidth,37);
customeLL.addView(a,curWidth,37);
builder = new AlertDialog.Builder(myClass.this);
builder.setView(customeLL);
ad=builder.create();
ad.show();
}
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,topborder和图像的空间为2-3 px.
我尝试在textview的背景上设置图像.一切都好但是..当我"setText("blyablya")"而不是文字没有显示.我试图使用setBackgroundResource和setBackgroundDrawable ...但总是在仅背景图像上,我无法从TextView看到文本(((
请任何人可以帮助我?
简单代码:
//tit - TextView tit
tit.setText("blabla");
tit.setTextColor(Color.BLACK);
tit.setBackgroundDrawable(getResources().getDrawable(R.drawable.popup_title));
Run Code Online (Sandbox Code Playgroud)
在帮助之后添加:如果正常可绘制比一切正常但是如果背景可绘制是9patch比这可能对你有帮助.
我正在寻找一种方法来完成其他的第一次活动
第一项活动是我的闪屏.我想在第二次活动建设时向他展示../下载数据和界面,并且在第二次活动的asynctask我想完成第一次活动.我不需要简单的延迟方式.这是可能的 ?
任何人都可以帮助我完成我的任务我有一个actvitiy我在新的Intent新活动中打开,而且在这个新的活动中我再次打开新意图(previsios活动没有关闭,所以我可以在设备上点击后退按钮返回给他们).我想写"退出按钮"并开始新的活动,我只能关闭一个previsios活动,但pre-previsios仍然是开放的.在理想它喜欢 - MainActivity - > SettingsActivity - > LogoutActivity(这里我们必须回到loginActivity)我试过
mIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Run Code Online (Sandbox Code Playgroud)
但没有运气:(
我尝试创建一个固定的最后一项的ArrayList.例如,在ArrayList中[0,1,2,last],我试图在倒数第二个位置而不是最后一个位置添加一个项目.所以,如果我想在之前添加一个新项目(比如说3)last,我会做类似的事情,arraylist.add(3)它会给出输出[0,1,2,last,3],这显然不是我的要求.可以告诉我怎么做吗?