小编aro*_*r11的帖子

Android:在res中使用SVG会导致错误:"文件名必须以.xml或.png结尾"

我刚刚更新了Android Studio 1.2.1.1,现在gradle在我的资源文件夹中遇到svg问题.我总是使用SVG没有问题,我希望它们将来会被"允许".

:app:mergeDebugResources
:app:mergeDebugResources FAILED
/home/petergriffin/folder1/another-app/MyAwesome-App/app/src/main/res/drawable-hdpi/logo.svg
Error:Error: The file name must end with .xml or .png
Error:Execution failed for task ':app:mergeDebugResources'.
> /home/petergriffin/folder1/another-app/MyAwesome-App/app/src/main/res/drawable-hdpi/logo.svg: Error: The file name must end with .xml or .png
Information:BUILD FAILED
Run Code Online (Sandbox Code Playgroud)

任何想法如何解决?

svg android gradle android-gradle-plugin

11
推荐指数
3
解决办法
2万
查看次数

为什么Android Studio告诉我使用getSupportActionBar()而不是getActionBar()?

只需添加一个非常简单的帮助活动(只是从资源文件中显示一段HTML文本)到一个非常简单的测试应用程序,在这个新的Android Studio 0.8.6测试版中,我收到以下警告,没有提供理由/理由:

应该使用getSupportActionBar而不是ActionBar名称

有谁知道为什么?

还有任何文档,因为Android Studio没有提供,也无法在Android站点上找到任何特定的内容.

如果有警告的理由,有人可以指出一个完整的例子,因为这个类几乎完全是通用的/大多数例子围绕例如

public class HelpActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_help);

    ActionBar actionBar = getActionBar();
    actionBar.setTitle(getString(R.string.action_help));

    TextView helpText = (TextView) findViewById(R.id.help_text);
    helpText.setText(Html.fromHtml(getString(R.string.help_markup)));
  }
}
Run Code Online (Sandbox Code Playgroud)

android android-fragments android-activity android-studio

5
推荐指数
1
解决办法
2827
查看次数